首页 > 技术文章 > sql -生成清库脚本

alisonGavin 2018-01-08 13:59 原文

利用游标cursor

 

 

declare
cursor c_sor is 
select table_name from user_tables where table_name like upper('pms%');

begin 
 for c in c_sor loop
       dbms_output.put_line('delete from  '|| c.table_name);
       dbms_output.put_line(' call proc_correct_tableandseq( Q'|| c.table_name || ' Q, QidQ, Qseq_' || c.table_name || ' Q)');
end loop;

end

  

推荐阅读