create or replace procedure temp_test_tb(A varchar2 ) is
lsql varchar(4000);
new_table_name varchar2(100);
fz_date timestamp(50);
begin
select timestamp(max(completion_dt)) into freeze_date from status where run_status=1;
new_table_name := 'common_' ||A|| '_' ||to_char(add_months(fz_date, -1), 'MON');
lsql:='insert into os_temp_tab_2'||
'select * from'||new_table_name||' WHERE ROWNUM<10';
execute immediate lsql;
commit;
end;
此查询抛出错误
在Oracle中缺少值关键字
。我的插入表与插入表的列相同。
答案 0 :(得分:2)
后方缺少空格
' select * from '||new_table_name|| ' WHERE ROWNUM<10 ';