2

I am trying to export a large query from a DB2 database to a text file on my desktop using IBM Data Studio and I can't seem to get anything to work. When I run the query and right click on the results tab->Export->All Results it only gives me the first 500 records. This table is going to be in the range of 15 MM records so I can't just change the display settings to allow it to display that many records. I cannot use the unload utility because it won't let me save the file to my desktop. Any ideas?

user1723699
  • 1,031
  • 6
  • 13
  • 27
  • Can you check if you can run "db2" command from terminal. db2 command line contains "export to" command. "export to" command will be the best choice to export data to your local machine, in which you have options of ixf, cvs and xml files. ** db2 export to /path/to/file OF ixf select * from mytable ** – Cahit Gungor Dec 24 '14 at 08:22

2 Answers2

4

Probably, the limit in the SQL Results is activated.

You should click in the upper left triangle in the "SQL results" view, then "Preferences...".

enter image description here

However, this is not a good way to export data, because you should fetch them into Data Studio and then export them via the GUI. It is better to use the "export" command.

AngocA
  • 7,655
  • 6
  • 39
  • 55
  • Can you help me with the export command? I am really not that experienced with this and when I try to use EXPORT I cannot get it to export the file to my desktop, it seems to just want to export it to the server (which I can't do) – user1723699 Aug 26 '14 at 20:46
  • I don't want to extract the entire table though, the whole thing is around 1.5 billion records and I only need the previous year. So where year(date_variable)=2014 – user1723699 Aug 26 '14 at 20:54
  • Then, you should consider to export to the server. The network traffic will be huge if you use Data Studio for that. – AngocA Aug 26 '14 at 21:16
  • Well if that was an option I would – user1723699 Aug 26 '14 at 21:33
0

IN the IBM Data Studio:

right click the table/view and ---->Data-----> Extract and Browse destination to drop the file.

kissi
  • 1