Reputation: 679
I'm running a SQL script in SQL Developer and wanting to export all the records it returns to a CSV file, roughly a few hundred thousand results.
Currently SQL Developer limits the number of rows it returns to 50.
I've tried the following to fix this:
Code I'm using is as follows:
var UWY varchar2(20);
var SHOWS_AT_DATE_DD_MON_YY varchar2(30)
exec :UWY := '2012';
exec :SHOWS_AT_DATE_DD_MON_YY := '31-dec-2014';
SPOOL "c:\act-2012.csv";
/* select statement */
SPOOL OFF;
Upvotes: 2
Views: 25767
Reputation: 51
Go to
Preferences-> Database-> Advanced -> increase the Sql Array Fetch Size
The max you can select here is 500, if you need more that you will have to export the results.
Upvotes: 5
Reputation: 51
Go to Preferences-> Database->Worksheet and you can change the limits there.
Upvotes: 5
Reputation: 679
I managed to resolve this issue by doing the following.
Running the script in SQL Developer (F5), then in the Query result window right clicking and pressing export and then following the instructions on screen.
Even though the query window only returned 50 results it exported all the results returned by the query.
Upvotes: 0