trimspool and linesize query [message #335259] |
Mon, 21 July 2008 11:30 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kknegi
Messages: 5 Registered: July 2008 Location: USA
|
Junior Member |
![kknegi](/forum/theme/orafaq/images/google.png)
|
|
Hi All,
I am facing difficulty while spooling records into a flat file.
The Records from the columns are of variable length.
For E.g. first line is of 100 bytes. second is of 120, third is of 200 bytes with 50 spaces in it.
I need to spool the file exactly the way its in the table. I don't want to trim the spaces. BUt as the record length is more than 80 bytes the output doesnt come formatted. if i give a fixed linesize the output comes in a fixed format.
output structure
line 1: "aaaaaaaaaaaaaaaaa aaaaaaa"
line 2: "aaaaaaaaaaaaaaaaaaa "
line 3: "aaa aaaaa aaaaaa "
SO i need the output (without commas)the way it is without trimming the spaces in the records.
Can anyone help me in this regard.
Thanks in advance
|
|
|
Re: trimspool and linesize query [message #335260 is a reply to message #335259] |
Mon, 21 July 2008 11:34 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68675 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Unfortunatly I don't think you can do it with just SQL*Plus.
A trick could be to replace the space by a not used character, trim the output and then in another step, like sed, replace the replacement character by a space.
Regards
Michel
[Updated on: Mon, 21 July 2008 11:35] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: spooling variable length file [message #335572 is a reply to message #335571] |
Tue, 22 July 2008 13:42 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68675 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
You had but you don't want to hear them.
Even if you don't like it the answer is NO.
Use another tool than SQL*Plus or do it as we said.
Regards
Michel
|
|
|