您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
oracle-loop循环
发布时间:2017-11-23 14:53:06编辑:雪饮阅读()
loop循环示例:
SQL> list
1 declare
2 i int :=0;
3 total int :=0;
4 begin
5 loop
6 i :=i+1;
7 total :=total+i;
8 exit when total>1000;
9 end loop;
10 dbms_output.put_line('sum 1 to ' || i ||'is'||total);
11* end;
SQL> /
sum 1 to 45is1035
PL/SQL procedure successfully completed.
关键字词:oracle,loop