Hi All,
I'm trying to spool records from my Oracle table into a fixed width text file. As you'll see below, I'm using the RPAD function to set the maximum width for my columns but for some reason the spool doesn't recognize the RPAD function and just uses some other arbitrary fixed width. Here's the code that I'm using:
Spool on
SET PAGESIZE 0
SET LINESIZE 1000
set feedback off
set echo off
set termout off
Spool "C:\spool_test.txt"
select
rpad(EDC_PREVALENCE_TIME_CATEGORY,30) as EDC_PREVALENCE_TIME_CATEGORY,
rpad(CRG_METHOD_TYPE,55) as CRG_METHOD_TYPE,
rpad(EDC_AGG_CD,10) as EDC_AGG_CD,
rpad(EDC_AGG_DESC,100) as EDC_AGG_DESC,
rpad(PHN,9) as phn
from table1
where rownum <=1000;
Spool off;
Another thing I am trying to do is add the column headings as the first row. I used to have "Set Heading On" at the top of my spool but that didn't seem to work either. I've figured out how to find a workaround to that but if anyone has suggestions I would appreciate it.
Thanks,
Ed