Unanswered: Exporting Results SQL Query - IBM Data Studio
I am running IBM Data Studio 4.1 on Windows and I am trying to export the results of a query that will be a rather large dataset and cannot figure out how to do it.
When I run the query I go to the results tab, right click, and select Export->All Results. However, this only gives me the first 500 records (seems to defeat the purpose of the all results option). Is there something I am doing wrong here? The data will be greater than 10 MM records so I don't want to try and display that many records and then export it.
Also, if there is an easier way, I am trying to just export a table based on a date range. The table has over 1 billion records as it is quite historical and I am just trying to get 2014. Is there a way to do that easier than running a query and exporting the results? I tried the export command but I don't think that will allow me to export the results to my desktop, it seems to only want to put it on the server and I only have read only rights so that is not an option.
If you can't write to locations on the server and want to use a GUI then try in DS411 to open the "SQL Results View Options" screen, which shows that the default number of rows fetched is 500. You can try increasing this and re-running the query. However this might be slow and also might exhaust the java heap depending on the number of rows for 2014.
If your workstation already has a configured db2 client installed on it, then you can run export at the command line after connecting (i.e. not using any GUI) and this will write the result-set to your workstation file-system if you correctly specify the command line.
Example at command line after successfully connecting:
db2 "export to myresult.del of del select ... from ... where ... order by ... with ur"