943,670 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Marked Solved
  • Views: 2730
  • Oracle RSS
Sep 21st, 2009
0

removing first blank line in csv file

Expand Post »
Hi,
I have written a sql script which takes the rows from a table and writes it to
a .csv file.

The script is as follows:-

Oracle Syntax (Toggle Plain Text)
  1. SET feedback off;
  2. spool output.csv;
  3. SET heading off;
  4. SELECT username||','||profession FROM users;
  5. spool off;

This works fine but output.csv contains a blank line at the top.
How can I get rid of that blank line?

Thanks in advance
Similar Threads
Reputation Points: 35
Solved Threads: 4
Light Poster
axeeffect2002 is offline Offline
33 posts
since Jul 2009
Sep 23rd, 2009
0

Re: removing first blank line in csv file

You have to add command SET PAGESIZE 0 at the top script

Oracle Syntax (Toggle Plain Text)
  1. SET PAGESIZE 0 -- <-- add this line
  2.  
  3. SET FEEDBACK OFF
  4. SET HEADING OFF
  5.  
  6. SPOOL OUTPUT.TXT;
  7. SELECT username||','||profession FROM users;
  8. SPOOL OFF;
Reputation Points: 10
Solved Threads: 4
Newbie Poster
babyDBA is offline Offline
8 posts
since Sep 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Oracle Forum Timeline: Multiple row insertion
Next Thread in Oracle Forum Timeline: Sql query to get max 5 values





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC