Question : Oracle sql plus extract

Hello

I am creating a flat file extract using sql plus in 10g using simple spool and have following questions:

How do I get rid of empty line appear at top and bottom of file
I need to add extra bytes (let say 50) at end of record/row for future accomodation

this is what I hv in the code
SET PAGESIZE 50000
SET LINESIZE 32000
SET HEADING OFF
SET FEEDBACK OFF
SET TRIMOUT ON
SET SHOW OFF
set space 0
SET TRIMSPOOL ON
SPOOL abc.txt
Select (...... );
SPOOL OFF

Thanks

Answer : Oracle sql plus extract

I assume you use PAGESIZE 50000 to avoid page breaks.  If you change this to PAGESIZE 0 you won't get the initial blank line.

I tried running your code (with my own sql statement) and I didn't see a blank line at the end of the file, only at the beginning.

The TRIMSPOOL setting is causing trailing space characters to be removed from the end of each record.  Without this you could add an expression like RPAD(' ',50) to get 50 spaces at the end of the record, but this extra 50 spaces will be removed while TRIMSPOOL is used.
Random Solutions  
 
programming4us programming4us