Hi,
I'm new to Oracle, so excuse me if I'm asking an obviuos question.. Basically I have a need to execute a loop concurrently (i.e. execute all of the outcomes of the loop in one go). I can do this easily from unix (just execute as a background process), but am struggling to find a way of doing it in Oracle.
Here's my loop code:
Using the above example, if it found 7 Src_ID, I'd like it to use 7 threads to run the procedure concurrently in one go for each of the loop outcomes.
Thanks.....
I'm new to Oracle, so excuse me if I'm asking an obviuos question.. Basically I have a need to execute a loop concurrently (i.e. execute all of the outcomes of the loop in one go). I can do this easily from unix (just execute as a background process), but am struggling to find a way of doing it in Oracle.
Here's my loop code:
Code:
SELECT DISTINCT CONTEXT_ID into :Tar_ID FROM CONTEXTS WHERE REPORTING_DATE=to_date('#REPORT_DATE#','YYYYMMDD') AND WORKSPACE_ID=2
;
SELECT PK_RD_WS INTO :PK_KEY FROM CONTEXTS WHERE CONTEXT_ID=:Tar_ID;
DELETE FROM T_CDR WHERE PARTITION_KEY=:PK_KEY;
for CONT in ( select context_id from contexts where reporting_date=to_date('#REPORT_DATE#','YYYYMMDD') AND WORKSPACE_ID<>2 )
loop
:Src_ID := CONT.context_id;
PACK_CONTEXT.CONTEXT_COPY_SET (103,:Tar_Id,:Src_ID);
end loop;
commit;
end;
Using the above example, if it found 7 Src_ID, I'd like it to use 7 threads to run the procedure concurrently in one go for each of the loop outcomes.
Thanks.....