1)--- 使用带参数的游标;
declare
CURSOR stock_cur(symbol_in VARCHAR2) IS
SELECT * FROM rate_combine_nr nr WHERE nr.combine_no=symbol_in;
stock_info stock_cur%ROWTYPE;
begin
OPEN stock_cur(‘G600000001‘); --打开游标;
loop
FETCH stock_cur INTO stock_info; --从游标中取值
exit when stock_cur%notfound;
dbms_output.put_line(stock_info.combine_no||‘-‘||stock_info.department_code);
end loop;
close stock_cur; --关闭游标
end;
本文出自 “小李广之博客” 博客,请务必保留此出处http://6817977.blog.51cto.com/6807977/1597120
原文地址:http://6817977.blog.51cto.com/6807977/1597120