Skip to Main Content

SQL & PL/SQL

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!

How to remove trailing spaces in SQL PLUS spool

user518071Oct 11 2010 — edited Oct 11 2010
Hi,
I've requirement to pull data from tables and I'm using sqlplus spool to automate data fetch from various tables:
I'm using the following script for the same :

set echo off
set feedback off
set pagesize 0
set linesize 2000
set heading on
set trimspool on
Spool table1.TXT;
prompt col1|col2|col3|col4|col5
select
LTRIM(RTRIM(col1))||'|'||
LTRIM(RTRIM(col2)) ||'|'||
LTRIM(RTRIM(col3)) ||'|'||
LTRIM(RTRIM(col4)) ||'|'||
LTRIM(RTRIM(col5)) ||'|'||
from TABLE1 ;
spool off


After using trimspool on option also I'm having trailing spaces issue how to fix it?

Thanks,
Mahender.

Edited by: user518071 on Oct 11, 2010 1:05 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2010
Added on Oct 11 2010
3 comments
25,616 views