游标定义支持into关键字
支持cursor xxx for select … into …的语法,写了into效果与没写等效
create or replace function fun_cur_test(v_deptno numeric) returns text as $$ declare v_dname varchar2 :=''; CURSOR curs1 for select dname into v_dname from dept where deptno=$1; begin for i in curs1 loop v_dname := i.dname; end loop; return v_dname; end; $$ language plpgsql; select fun_cur_test(10);