时间:2021-07-01 10:21:17 帮助过:13人阅读
select class_name into cursor_2 from class where ...;
可以使用
for xxx in cursor
loop
....
end loop; --对Cursor进行遍历
end pro_test;
SYS_REFCURSOR型游标
create or replace procedure pro_test(rsCursor out SYS_REFCURSOR) is
cursor SYS_REFCURSOR;
name varhcar(20);
begin
open cursor for
select name from student where ...; --使用open来打开进行赋值
--遍历
loop
fetch cursor into name --fetch into来打开遍历的每条数据
exit when cursor%NOTFOUND; --未找到记录信息
dbms_output.putline(xxxx);
end loop;
rsCursor := cursor;
end pro_test;
http://www.cnblogs.com/sc-xx/archive/2011/12/03/2275084.html
return sql ret
标签:line bash targe 过程 条件 sql lin var tar