两种定义一样吗

mmhhllRen 2004-11-22 10:38:53
1 type rcType is Ref Cursor

2 cursor rcType is select 语句
...全文
75 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluelamb 2004-11-22
  • 打赏
  • 举报
回复
1.
open rcType for'select * from aa';,可以作为参数传出
2.不可以
二者的区别是1是一种游标的类型,像varchar2一样,但是2时一个游标的记录集
zhaokeke2004 2004-11-22
  • 打赏
  • 举报
回复
2. 做为参数传递记录集
type empcurtyp is ref cursor return emp%rowtype;
procedure open_emp_cv(emp_cv in out empcurtyp) is
.............
open emp_cv for sele_statament
loop
fetch emp_cv into emp_rec
...........
exit when ....
end loop
close emp_cv
mmhhllRen 2004-11-22
  • 打赏
  • 举报
回复
有何区别,请明示
zhaokeke2004 2004-11-22
  • 打赏
  • 举报
回复
用法有点区别
zhpsam109 2004-11-22
  • 打赏
  • 举报
回复
type rcType is Ref Cursor 是定义一种类型!

使用的时候,还要声明:rcCursor rcType;
open rcCursor for select ...............

cursor rcType is select..........定义游标变量!相当于如上两句!

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧