首页 > 其他 > 详细

游标 根据目录号 操作用户 查看 对应得影像数

时间:2016-08-16 16:01:07      阅读:116      评论:0      收藏:0      [点我收藏+]

declare

--定义一个变量
icount number(18);
begin
for cur_entry in (

--查询的语句根据目录号、用户查询出entry_id,案卷号

select entry_id,file_code from am_c_entry where catalogue_code=‘B-11-1-11‘ and
created_by=‘sa‘

) loop

--变量初始值
icount:=0;
execute immediate ‘

select count(*) from am_c_page where entry_id=‘||cur_entry.entry_id into icount;

--输出符合条件的结果
dbms_output.put_line(‘案卷号:‘||cur_entry.file_code||‘影像数:‘||icount);
end loop;
end;

输出如下:

案卷号:1影像数:8

游标 根据目录号 操作用户 查看 对应得影像数

原文:http://www.cnblogs.com/ylldbk/p/5776523.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!