下面看下oracle游标的简易用法,具体代码如下所示: create or replace procedure NW_DelYW(ioPERATION_ID number,
下面看下oracle游标的简易用法,具体代码如下所示:
create or replace procedure NW_DelYW(ioPERATION_ID number,
sUserID varchar2) is
sCurDJBH yw_operation_link.djbh%type;
cursor table_yw(ywid yw_operation.id%type) is
select * from yw_operation_link t1 where t1.operation_id = ywid;
begin
for dr in table_yw(iOPERATION_ID) loop
sCurDJBH := dr.djbh;
--取得opercationid
--写日志
insert into log_zfywinfo
(DJBH,
DJDL,
DJXL,
DLMC,
XLMC,
SLR,
SLRID,
SQRXM,
FWZL,
ZFRQ,
ZFRID,
zfr)
select distinct sCurDJBH,
t4.id,
t3.id,
t4.name,
t3.name,
t1.slry,
t1.slryid,
t1.SQRXM,
t1.zl,
sysdate,
sUserID,
(select tt.name from pw_user tt where tt.id=sUserID)
from yw_operation t1
join yw_operation_link t2
on t2.operation_id = t1.ID
join BUSINESS_TYPE t3
on t3.id = t1.business_id
join BUSINESS_CLASS t4
on t4.id = t3.parent_id
where t1.ID = dr.operation_id;
exception
when others then
rollback;
dbms_output.put_line(sqlerrm);
end NW_DelYW;
--结束END--
本文标题: 详解Oracle游标的简易用法
本文链接: https://www.lsjlt.com/news/51482.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0