Force TO_CHAR to eliminate the leading blank during display
Date: 13 Oct 92 20:00:21 GMT
Message-ID: <38330_at_arctic.nprdc.navy.mil>
I wrote a small SQLPLUS script to convert the Oracle data to an ASCII file. As you can see from the script, I had 1 numeric field in the table. In addition, I also put out 4 '|'s as field delimiters. QUESTION: How come there is alwayw an extra blank preceeding the numeric field (Argument_Number), even though I explicitly set "space 0", and provided the TO_CHAR function with a format of '09'.
- SQLPLUS Script *
spool trargs.txt
TTITLE off
set heading off
set linesize 78
set pagesize 0
set feedback off
set space 0
select
Function, '|',
TO_CHAR(Argument_Number,'09'), '|',
Description, '|',
Data_Type, '|'
from TRANSFORMATION_ARGUMENTS order by 1 ASC, 3 ASC;
spool off
exit
*Schema *
CREATE TABLE TRANSFORMATION_ARGUMENTS
(
Function CHAR(30) NOT NULL,
Argument_Number NUMBER(2) NOT NULL,
Description CHAR(40),
Data_Type CHAR(1)
);
*Sample Output: TRARGS.TXT *
Are_Lists_The_Same | 01|First generic list |G|
Are_Lists_The_Same | 02|Second generic list |G|
Extract_Sub_List | 01|Original generic list |G|
Extract_Sub_List | 02|Index of comparison column |I|
Received on Tue Oct 13 1992 - 21:00:21 CET