Tags: command, database, db2, editor, file, instead, mysql, oracle, query, redirect, screen, showing, sql, text, udb, version

UDB 8.2 Command Editor - How do you redirect results to a file?

On Database » DB2

2,396 words with 6 Comments; publish: Thu, 06 Dec 2007 06:04:00 GMT; (25061.52, « »)

In version 7, you could go File | Options and redirect the query results to a text file instead of showing them on the screen. How do you do that with version 8? :confused:

All Comments

Leave a comment...

  • 6 Comments
    • and : selected -> export

      gives you the possibility to export data in different formats ?

      Best Regards, Guy Przytula

      #1; Tue, 11 Dec 2007 18:02:00 GMT
    • To save the Result Set in V8.1, from the "Results" tab, select Query Results -> Save Data.

      Andy

      #2; Tue, 11 Dec 2007 18:03:00 GMT
    • and : selected -> export

      gives you the possibility to export data in different formats ?

      Best Regards, Guy Przytula

      Unfortunately, no good.

      What if I have 2 million rows returned by my query and the Command Editor only shows me 100 at a time? Do I have to hit "Fetch More Rows" 20,000 times before I can export? When you export, you only export what's being displayed (I tried). The alternative would be to change the number of rows displayed and disable filtering, doing the export and then going back to 100 returned and 500 for filtering or something like that every time you do an export.

      Regardless, on top of that what if I don't want to export in DEL format, forced to have a column delimiter, but, instead, I want a columnar output like the one I could get in version 7? Something I can e-mail just as is and people can print and read just as is?

      #3; Tue, 11 Dec 2007 18:04:00 GMT
    • To save the Result Set in V8.1, from the "Results" tab, select Query Results -> Save Data.

      Andy

      Where is that "Save Data"? I am at the Query Results tab and don't see any button or menu option that says "Save Data." :confused:

      #4; Tue, 11 Dec 2007 18:05:00 GMT
    • IBM seems to have changed how the "Command Center" in V 8.1 now "Command Editor" in V8.2 works in this area. What I suggest you do is this.

      Get the query the way you want it. Then issue an EXPORT command based on that query.

      Andy

      #5; Tue, 11 Dec 2007 18:06:00 GMT
    • That's almost the same thing as doing an export once you get the results, although it does save you the continuous fetching. However, it still does not export in a columnar way, the way version 7 used to? That is:

      FIELD1FIELD2FIELD3

      -------

      12345ABCDE67890

      65A56

      5665CRE46576

      Instead, the closest you can get to this would be DEL (without column headers, to top it off):

      12345,ABCDE,67890

      65,A,56

      5665,CRE,46576

      I really wonder why IBM should give me some new features and take away some that were quite useful.

      #6; Tue, 11 Dec 2007 18:07:00 GMT