No way to know for sure w/o seeing your SQL.
Give us an example.
And be ready to be told you need to upgrade.
Have you tried set trimspool on?
It may not have been implemented yet in your version, but in SQL*Plus that will remove trailing spaces.
Thanks, Jim, but set trimspool on is skipped in the version of developer I'm using.
The SQL in the script file is below. To be honest, I have reduced it down to a simple select from dual and it still puts extra spaces at the end of the single line.
col ord noprint
SELECT ' ' ord,
SELECT zone_name ord,
ORDER BY ord;
Before I dig too deep into this:
Do you know that SQL Developer already has an automatic CSV formatter for query results? Run your query, go to grid, right-click > Export > CSV
Yes, I have been using the export facilitiy until now. But I wanted a single script I could run for a group of queries rather than having to manually export each one in turn. I have done it by inserting the query results into a new set of tables and exporting them, but it's still rather unwieldly. I also had a problem where a different script I ran changed the default date format, which changed the export format, so causing problems for the recipient of the data. I also tried the /*csv*/ hint method. This seems to work intermittently in the version of SQL Ddeveloper I'm using.
Looking at this further, SQL Developer seems to have padded each line out with spaces to the same width in the spool file. I have now tried running the scripts in SQL*Plus instead. After using set trimspool on and set linesize 999 the spooled output now looks good. It hasn't yet been loaded by the recipient, but hopefully it should be good.
So, not quite as convenient having to use SQL*Plus when I normally work with SQL Developer, but not too bad.
Thanks for the replies, Jeff.
Yeah, we don't support trimspool yet, but we do support the /*CSV*/ formatting stuff. If you upgrade to 4.0 and find it still not reliable, let us know - it would be a bug.