标签:
declare
inst_name varchar2(100);
cursor mycur is
select * from tran_forward t where t.instrument_type_id=‘3010‘;
query_row tran_forward%rowtype;
begin
open mycur; --打开游标
loop
fetch mycur into query_row; --把游标所指的纪录放到变量中
select t.instrument_type_name into inst_name from bas_instrument_type t where t.instrument_type_id=query_row.instrument_type_id;
exit when (mycur%notfound); --当游标没有指向行时退出循环
DBMS_OUTPUT.put_line(‘SEQ有:‘ || query_row.forward_id || ‘条记录‘);
execute immediate
‘insert into tran_sumary_infomation
(id,
transaction_id,
tran_type_name,
tran_link_url,
tran_entity,
tran_type_id)
values (:1,:2,:3,:4,:5,:6)‘
using hibernate_sequence.nextval,query_row.forward_id ,inst_name,‘/Tran/TranForwardEdit.aspx‘,‘TranForward‘,query_row.instrument_type_id;
commit;
end loop;
close mycur;
end;
标签:
原文地址:http://www.cnblogs.com/kexb/p/4910936.html