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!

Producing a pipe-delimited file using SQL*Plus

595007Dec 11 2008 — edited Dec 11 2008
This script

set colsep '|'
spool outfile.lst
select fname,lastname,midinit from mytab;
spool off

produces this outfile.lst

john |doe |A
richard |roe |B

In other words, it pads the names with blanks up to the width of the column, 9 characters, even though the data is varchar.

I would like to get variable length fields, without blank padding, like this

john|doe|q
richard|roe|x

Can I do this in SQL*Plus by setting system variables or the COLUMN command?

-- Chris Curzon
This post has been answered by Frank Kulash on Dec 11 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2009
Added on Dec 11 2008
3 comments
2,513 views