Skip to Main Content

SQL Developer

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!

Exporting rows from Oracle to Excel

3622787Jan 19 2018 — edited Jan 23 2018

Hello,

I need to export the data from a table using a script in SQL Developer into a csv file , I am using SQLPLUS to do it, and it works as long the table doesn't have more than 5000 records

SET SQLFORMAT CSV

SET COLSEP ','

SPOOL c:\temp\MyTable.csv

SELECT col1,',', col2 FROM MyTable_CODE;

SPOOL OFF

I can increase the maximum of number of rows in Tools>Preferences>Database>worksheet Parameters, so I can export for example 10000 rows, but if I keep increasing that number the spool functionality just doesn't work. My table has almost 400.000 records, so if I set the worksheet parameters to 400.000 then I get the following when I run my SQLPLUS code

line 3: SQLPLUS Command Skipped: SET SQLFORMAT csv

line 4: SQLPLUS Command Skipped: SET COLSEP ','

Any ideas how to make this work with unlimited number of records?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2018
Added on Jan 19 2018
18 comments
4,196 views