Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

eliminate spaces in csv file

user106161Apr 20 2012 — edited Apr 20 2012
Hi,

db version:10.2.0.4.0
o/s: windows 2003

I have the following script which works fine except for one thing. I spool the output to csv file and after the last field (STUREF) there are so many spaces. STUREF is a number field. I tried using RTRIM but it doesnot help .
set linesize 192
column studata format A190

spool &OPPATH.ADD&RUN_NO..csv

select
'cn'||','||'Description'||','||'givenName'||','||'sn'||','||'initials'||','||'LastDigit'||','||'Stu_ID' studata
from dual
/
select
STU_ID||','||CRSLIST||','||FIRST_NAME||','||SURNAME||','||MID_INITIAL||','||substr(rtrim(STU_ID),-1)||','||STUREF studata
from LOC_STUEMAIL
where STU_ACT = 'A'
order by STU_ID
/
spool off 
Thank u for help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2012
Added on Apr 20 2012
4 comments
118 views