- 1、显示游标
- declare
- cursor cur_1 is select a.cust_name from ea_cust.cust_info a;
- cust_name varchar2(100);
- begin
- open cur_1;
- loop
- fetch cur_1 into cust_name;
- exit when cur_1%notfound;
- NULL;
- end loop;
- close cur_1;
- end;
- --耗时48秒
- 2、隐式游标
- declare
- begin
- for cur_2 in (select c.cust_name from ea_cust.cust_info c) loop
- NULL;
- end loop;
- end;
- --耗时16秒
Oracle 游标(显示+隐式)
最新推荐文章于 2023-03-12 21:22:32 发布