oracle存储过程Loop循环一张表插入到另外一张表
oracle存储过程Loop循环一张表插入到另外一张表1、创建一个存储过程Sql代码create or replace procedure inserttest ascursor cs is SELECT sales_id FROM t02salesinfo_backup;sales_id varchar(128);beginfor c in cs loopBEGINinsert into gf_target_personaltarget(USER_ACCOUNT_ID,PERSONAL_VFYP)values(c.sales_id,'500');END;end loop;end inserttest;2、清空你要插入数据的表Sql代码truncate table gf_target_personaltarget;3、在命令行执行存储过程Sql代码call inserttest();-------这里是有小括号的,有参数还需要传参!commit;