Created
June 19, 2018 10:09
-
-
Save mayurdange/d3735b60f4a43074cb0a34c599af49e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET SERVEROUTPUT ON; | |
| CREATE OR REPLACE PROCEDURE a_proc | |
| AS | |
| CURSOR acteurs_cur IS | |
| select ACTID, CJUCODE, LANCODE, UTICODECREAT, PAYCODE, ACTCODE, ACTLIBCOURT, ACTNOM from acteur where actid in (1,242); | |
| CURSOR acteurs_cur2 IS | |
| select ACTID, CJUCODE, LANCODE, UTICODECREAT, PAYCODE, ACTCODE, ACTLIBCOURT, ACTNOM from acteur where actid in (245,246); | |
| acteurs_t acteurs_cur%ROWTYPE; | |
| TYPE acteurs_ntt IS TABLE OF acteurs_t%TYPE; | |
| l_acteurs acteurs_ntt; | |
| l_acteurs2 acteurs_ntt; | |
| BEGIN | |
| OPEN acteurs_cur; | |
| FETCH acteurs_cur BULK COLLECT INTO l_acteurs; | |
| CLOSE acteurs_cur; | |
| OPEN acteurs_cur2; | |
| FETCH acteurs_cur2 BULK COLLECT INTO l_acteurs2; | |
| CLOSE acteurs_cur2; | |
| l_acteurs := l_acteurs MULTISET UNION l_acteurs2; | |
| FOR indx IN 1..l_acteurs.COUNT LOOP | |
| DBMS_OUTPUT.PUT_LINE(l_acteurs(indx).ACTID); | |
| END LOOP; | |
| --WIP :( in case we want to return a combined cursor | |
| END a_proc; | |
| / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment