oracle 游标示例

declare
iCount int:=0;
sPath nvarchar2(200);
tdzsh nvarchar2(50);
begin
for x in (select c.imgpath from imgfolderpath c) loop
NULL;
--dbms_output.put_line(x.imgpath);
icount := icount+1;
spath:=x.imgpath;

end loop;

--iCount:=SQL%rowcount;
DBMS_output.put_line('影响了'||iCount||'行');
DBMS_output.put_line(spath);

for x in (select d.djkid,d.bz1,d.qlr,d.tdzl from djk_tab d) loop
icount :=0;
tdzsh:=x.bz1;
--for y in (select c.imgpath from imgfolderpath c where c.imgzsbh=tdzsh) loop
-- spath:= y.imgpath;
-- icount:=icount+1;
--end loop;
select count(c.imgzsbh) into icount from imgfolderpath c where c.imgzsbh=tdzsh;
end loop;

icount:=SQL%rowcount;
if icount>0 then
DBMS_output.put_line(1);
else
DBMS_output.put_line(0);
end if;
end;

格式化GUID:

select sys_guid() from dual;

SELECT REGEXP_REPLACE (sys_guid()
, '(........)(....)(....)(................)'
, '{\1-\2-\3-\4}'
) AS formatted_guid
FROM dual;

上一篇:$_session (应用)


下一篇:一个使用高并发高线程数 Server 使用异步数据库客户端造成的超时问题