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;