将oracle表A表的部分数据一次性导入到表B中 , 以A_ID为外键关联.
declare
B_SEQ number(10);
cursor cur_A is select user_id from sec_user_group_rel r where r.group_id='601122' ;
begin
for a in cur_A
loop
select DGHY_YJHC_SEQ_1.nextval into B_SEQ from dual;
insert into sec_users_pa (UP_ID, USER_ID, STATUS, CREATE_DATE, UPDATE_DATE, CERT_TYPE_ID, SUB_SYSTEM)
values (B_SEQ, a.user_id, 1, SYSDATE, SYSDATE, 1, '01');
end loop;
commit;
end;
参考:https://www.cnblogs.com/coloz/p/11168550.html