1.游标类型
--定义一个游标类型
declare
type emp_cursor is ref cursor;
--定义一个游标变量
test_cursor emp_cursor;
v_ename xxx.xxx%type;
v_esal xxx.xxx%type;
begin
--执行
--把test_cursor和一个select结合
open test_cursor for select xxx,xxx from xxx where xxx;
--循环取出
loop
fetch test_cursor into v_ename,v_esal;
exit when test_cursor%notfound
end loop;
end;
2.注意plsql的写法 elsif 不是elseif. 少一个e
3.几种循环
1)loop.......end loop
2) while ......loop ..... end loop;
3) for i in reverse 1..10 loop ......... end loop