oracle语法备忘-游标
程序员文章站
2022-03-13 10:29:58
...
oracle的游标备忘
显示游标
declare cursor cur_sel is select t.month_id,t.prov_id from table t where rownum < 100; var_1 table.Month_Id%type; var_2 table.Prov_Id%type; begin open cur_sel; loop fetch cur_sel into var_1,var_2; exit when cur_sel%notfound; dbms_output.put_line(var_1||' '||var_2); end loop; close cur_sel; end;
动态游标
declare type mytype is ref cursor; mycur mytype; var_1 table.Month_Id%type; var_2 table.Prov_Id%type; begin open mycur for select t.month_id,t.prov_id from table t where rownum < 100; loop fetch mycur into var_1,var_2; exit when mycur%notfound; dbms_output.put_line(var_1||' '||var_2); end loop; close mycur; end;
上一篇: google map 基础函数使用备忘
下一篇: 介绍一种网络笔记备忘的方式