일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- phonegap
- Android
- WebLogic
- ibsheet
- JSON
- tomcat
- jsr 296
- JDOM
- Struts
- appspresso
- 가우스
- PLSQL
- PHP
- Eclipse
- Spring
- 전자정부프레임워크
- Google Map
- MySQL
- dock
- node.js
- GPS
- oracle
- iBATIS
- MFC
- Ajax
- rowspan
- 선택적조인
- jQuery
- sencha touch
- swingx
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;
/