cursor c1 is select id,a,b,c from table1;
r1 c1%rowtype;
cursor c2 is select id,x,y,z from table2 where id=r1.id;
r2 c2%rowtype;
然后先fetch第一个游标,在循环中fetch第二个游标
r1 c1%rowtype;
cursor c2 is select id,x,y,z from table2 where id=r1.id;
r2 c2%rowtype;
然后先fetch第一个游标,在循环中fetch第二个游标
解决方案 »
- 连接数据库报错
- 请问ORACLE 数据库 有按照模糊表名来查询统计的命令么?
- 怎么没人解答我这个问题啊!没人知道么?怎么用vs调用oracle的存储过程?
- 恢复报错! 急 急
- 有一个复杂的sql查询语句,想用存储过程来写,返回查询结果集合,格式改怎么写
- 缺少右括号 的错误 我的版本是9.0.1
- group by 遇到困难
- oracle 中文不能识别问题
- 为什么我在存储过程中使用dba_free_spaces之类的视图时,oracle总提示没有定义的变量?
- 请问:在Oracle的SQLPlus Worksheet中,执行某个函数或存储过程的语句应该怎么写?
- 关于创建过程的问题
- 关于更新语句的写法
close TABLE_SEND;
end if;
open TABLE_SEND;
loop
fetch TABLE_SEND into RecRowSend ;
exit when TABLE_SEND%notfound;
if(cu_pro%isopen) then
close cu_pro;
end if;
sqlSendSub:= 'Select oid from ' || RecRowSend.mTbName || ' where nvl(trflag,''N'')!=''Y''';
open cu_pro for sqlSendSub;
loop
fetch cu_pro Into li_Recordid;
exit when cu_pro%notfound;
if(li_Recordid is not null) then
p_mq_send(RecrowSend.mTbName,'OID',li_Recordid,RTN_CODE,RTN_MSG);
-- 如果写入成功 ,更新状态位
if(RTN_CODE='0') then
sqlSendSub:= ' delete from ' || RecRowSend.mTbName || ' where oid=' || li_Recordid ;
execute immediate sqlSendSub;
commit;
end if;
end if;
end loop;
if(cu_pro%isopen) then
close cu_pro;
end if;
end loop;