PL/SQL Developer Test script 3.0
32
– Created on 2019/4/12 by ADMINISTRATOR
declare
– Local variables here
sqh0 varchar2(20) := ‘2017800396689’;
sql0 varchar2(200);
cursor cur_daiqingli is
SELECT * FROM USER_COL_COMMENTS col where col.column_name IN (
SELECT col.column_name FROM USER_COL_COMMENTS col where col.comments = ‘申请号’ group by col.column_name ,
‘ZHUANLISQH’ , ‘YEWUZTBH’
) ;
–定义游标变量
eachrowfj cur_daiqingli%rowtype;
begin
dbms_output.enable(10000000);
– Test statements here
open cur_daiqingli;
loop
begin
fetch cur_daiqingli
into eachrowfj;
exit when cur_daiqingli%notfound;
sql0 := ‘insert into ‘|| eachrowfj.table_name ||’ select * from ‘|| eachrowfj.table