declare
type xn_dept_cursor is ref cursor;
test_cursor xn_dept_cursor;
和
declare
cursor c1 is select ......这两种有什么区别?安全性上执行速度还是就是写法不一样?
type xn_dept_cursor is ref cursor;
test_cursor xn_dept_cursor;
和
declare
cursor c1 is select ......这两种有什么区别?安全性上执行速度还是就是写法不一样?
后者是显式游标,结果集确定。
速度要看其具体SQL语句,并没有绝对的区别。
open test_cursor for select......
以后在别的地方再
open test_cursor for select......
对吧?最后在结尾关闭游标?
前者常用于做报表,返回结果集。后者常用于loop,循环处理。需要手动关闭。