PL/SQL_2

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值