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!

extract to csv -spaces at end of record depending on the set linesize param

user12231178Apr 5 2011 — edited Apr 5 2011
I'm running a query to extract a table to a csv file and need to eliminate all of the trailing spaces on the final record. I appears as if the number of trailing spaces is based on the record length versus the defined linesize. Is there a way to eliminate all of the trailing spaces without playing with the linesize for each query?

example:

spool foo.csv
set linesize 400;

select company || ', ' || location from schema.sometable;
spool off;



In the above example if the company field is 30 characters in length then the location field will be 370 characters in length--even if I use the trim command.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 3 2011
Added on Apr 5 2011
5 comments
213 views