-
spooling
Can i use spooling within a loop.
I need to generate dynamic files using spool based on the information from the 'for' loop.
If not possible wats the alternate solution.
Can i use spool within procedure. I think this is not possible.
-
HI
Dynamic spool is not posible through procedure but you can used UTL_FILE for generate dynamic file.
Thanks
-
Alternative would be to write data into one or more several temporary tables and then create flat files using temp tables after loop has finished.
VERY ROUGH EXAMPLE BELOW:
LOOP
IF CONDITION1 MET THEN
INSERT INTO TEMPTABLE1 VALUES (?)
ELSE...
INSERT INTO TEMPTABLE2 VALUES (?)
FI
END LOOP
SPOOL REPORT1.SQL
SELECT * FROM TEMPTABLE_1
SPOOL OFF
SPOOL REPORT2.SQL
SELECT * FROM TEMPTABLE_2
SPOOL OFF
-
thanks chuk and POS ...... i did it using UTL_FILE...... i uz got it wen i was juz luking at various options.......
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|