Results 1 to 4 of 4

Thread: spooling

  1. #1
    Join Date
    Mar 2007
    Posts
    6

    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.

  2. #2
    Join Date
    May 2007
    Posts
    1
    HI

    Dynamic spool is not posible through procedure but you can used UTL_FILE for generate dynamic file.

    Thanks

  3. #3
    Join Date
    May 2007
    Posts
    13
    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

  4. #4
    Join Date
    Mar 2007
    Posts
    6
    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
  •