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!

sqlplus spool and keep varchar widths, left justified

bubblefishMar 7 2014 — edited Mar 7 2014

I am a sqlplus newb.  I have a table definition similar to the below:

id VARCHAR2(10)

address VARCHAR(40)

etc...

I would like to be able to spool the contents of the table, where the fields maintain their max varchar widths, and concat together.  So for example:

id : 0123456789

address: This is an 40 char address with spaces in it

I'd like to spool the output of the table, and have it look like:

0123456789This is an 40 char address with spaces in it

What I get is :

0123456789 This is an 40 char address with spaces in it               

I've played with trimspool, linesize, pagesize, but like in the above example: Why is it putting spaces between fields id and address?  This is data loaded from a ctl file, via sqlldr, which used positional notation to load the data.  All I want to do is to be able to export the (now filtered) data, back into a text file, looking like it did when it was imported.

Could it be that it right-justifies the output?

Thanks for the assistance.  Hope this wasn't too confusing :-)

This post has been answered by BluShadow on Mar 7 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2014
Added on Mar 7 2014
13 comments
2,366 views