Sql*Plus Spool file issue with .csv file format [message #414594] |
Wed, 22 July 2009 18:12  |
kumar29
Messages: 6 Registered: July 2009
|
Junior Member |
|
|
Hi,
I executed a SQL statement and capturing the results to a spool file. The file is .csv format. After complete the execution I open the csv file and observed that an extra space is padding for each column
I tried to put the set operations as
Set serveroutput on
Set lines 5000
Set feedback off;
Set heading off;
Set trimspool off;
Set pages 0;
Set trim on;
Set trims on;
Set colsep ","
Spool c:\Result.csv
Select col1, col2 .......
/
Spool off
/
Exit
/
Could you please advise what might be causing this problem with .csv format and how to handle it? Thanks for your time.
|
|
|
|
|
|
|
Re: Sql*Plus Spool file issue with .csv file format [message #414792 is a reply to message #414605] |
Thu, 23 July 2009 08:20   |
kumar29
Messages: 6 Registered: July 2009
|
Junior Member |
|
|
Thank you very much.
I tried your option and its worked as expected.I would like to tweak litte more to get more accurancy in data. I used comma(,) as concatination.There may be chance in my data like address fields has , . I thought of use any other character while doing concatination.
Any thoughts with out preparing own string as column1||','||column2||','||column3 ... and remove the padding space for each column while spooling to a .csv file.
Please let me know if you any input from my side.
Thanks again for your time.
[Updated on: Thu, 23 July 2009 08:22] Report message to a moderator
|
|
|
|
|