标签:
DECLARE TYPE rr IS REF CURSOR; TYPE r_emp IS RECORD( empno NUMBER(4), ename VARCHAR2(10), job VARCHAR2(9), mgr NUMBER(4), hiredate DATE, sal NUMBER(7, 2), comm NUMBER(7, 2), deptno NUMBER(2)); TYPE t_e IS TABLE OF r_emp; e t_e; ee t_e:= t_e(); r rr; BEGIN OPEN r FOR SELECT * FROM apps.emp; LOOP EXIT WHEN r%notfound;--写在FETCH后面会掉数据 FETCH r BULK COLLECT INTO e LIMIT 5; ee := ee multiset union e; END LOOP; for i in 1..ee.count loop dbms_output.put_line(ee(i).empno); end loop; END;
ORACLE fetch bulk collect into limit
标签:
原文地址:http://www.cnblogs.com/wolil/p/5688929.html