让我们看看老版本的oracle 是怎么执行动态SQL的
create or replace procedure scheam1.trunc*** as
source_cursor integer;
rows_processed integer;
native constant integer := 1;
begin
source_cursor := dbms_sql.open_cursor;
dbms_sql.parse(source_cursor,
'truncate table ****** reuse storage',
native);
rows_processed := dbms_sql.execute(source_cursor);
commit;
dbms_sql.close_cursor(source_cursor);
exception
when others then
if dbms_sql.is_open(source_cursor) then
dbms_sql.close_cursor(source_cursor);
end if;
raise;
end;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/412/viewspace-903899/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/412/viewspace-903899/