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!

preserve a single space at the end of line using spool command

695970Apr 13 2009 — edited Apr 14 2009
Hi,

Can you please help me to write the result of an sql query into a file with the last column of the row ending with a single space?

For example:

COL1DATA|COL2DATA|COL3DATA<space1>

As mentioned in the example the col3 value in the file should end with a single space. And there should not be any delimiters at the end of the row.

I tried with set trimspool on/off. But, it didn't work. When I say trimspool on - it is trimming all the trailing spaces.
When I say trimspool off - it is retaining all the trailing spaces to the size of the line.
But, I do not wish to modify the file through shell commands once it is written thru spool. I mean I do not wish to append spaces to the end of a line using shell script or any other method.
I do not wish to use other methods like UTL_FILE also.

Please help me how to do it using spool command?

Thank you.
Ramana
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2009
Added on Apr 13 2009
8 comments
1,719 views