spool file test.txt
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: spool file test.txt

  1. #1
    Join Date
    Jul 2001
    Posts
    334

    spool file test.txt

    I have to extract the data and create a spool file, the data length is not fixed. What is the best approach of using SET commands if the record length is not fixed. Please help.

    Set newpage 0
    Set pagesize 0
    Set feedback off
    Set verify off
    Set echo off
    Set tab off
    Set heading off
    Set recsep off
    set termout on

    Thanks
    Last edited by aph; 01-29-2004 at 10:27 AM.

  2. #2
    Join Date
    May 2001
    Location
    San Francisco, California
    Posts
    510
    If you are not able to speficy format by set commands for whatever reason, I would use builtin functions and concatenate operator to produce a comma delimited file usable in windows xcel and for sqlldr like this:

    spool file.txt
    select substr(col1,1,100)||','||rpad(col2,20,' ')||','||ltrim(col3)||','||col4 from table where ...
    spool off
    Last edited by kris109; 01-29-2004 at 01:44 PM.
    Remember the Golden Rule - He who has the gold makes the rules!
    ===================
    Kris109
    Ph.D., OCP 8i, 9i, 10g, 11g DBA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width