일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- jsr 296
- Struts
- appspresso
- MySQL
- iBATIS
- 전자정부프레임워크
- jQuery
- Google Map
- rowspan
- ibsheet
- Spring
- Eclipse
- dock
- swingx
- Android
- PLSQL
- oracle
- MFC
- JSON
- tomcat
- GPS
- JDOM
- Ajax
- 가우스
- node.js
- phonegap
- PHP
- 선택적조인
- sencha touch
- WebLogic
Archives
- Today
- Total
Where The Streets Have No Name
BULK COLLECT & FORALL vs. CURSOR & FOR-LOOP 본문
참조 : https://geraldonit.com/2007/09/27/bulk-collect-forall-vs-cursor-for-loop/
CREATE OR REPLACE PROCEDURE BULK_COLLECT_QUERY
IS
TYPE SOWNER IS TABLE OF VARCHAR2 (30);
TYPE SNAME IS TABLE OF VARCHAR2 (30);
TYPE STYPE IS TABLE OF VARCHAR2 (19);
L_SOWNER SOWNER;
L_SNAME SNAME;
L_STYPE STYPE;
BEGIN
DBMS_OUTPUT.PUT_LINE ('Before Bulk Collect: ' || SYSTIMESTAMP);
SELECT OWNER,
OBJECT_NAME,
OBJECT_TYPE
BULK COLLECT INTO L_SOWNER,
L_SNAME,
L_STYPE
FROM ALL_OBJECTS;
DBMS_OUTPUT.PUT_LINE ('After Bulk Collect: ' || SYSTIMESTAMP);
FORALL INDX IN L_SNAME.FIRST .. L_SNAME.LAST
INSERT INTO TEMP
VALUES (L_SOWNER (INDX), L_SNAME (INDX), L_STYPE (INDX));
DBMS_OUTPUT.PUT_LINE ('After FORALL: ' || SYSTIMESTAMP);
COMMIT;
END;
/