Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: How to set ouput of terminal when using list application command

    Hi,
    using db2 v9.5 Linux. When executing "db2 list application show detail" command I get really ugly output - multiple lines and columns data are all mess up.

    I was talking to my friend, he is using mysql database, and he said this can be done in mysql using some -g switch.

    How to make display of output in one sigle long line? Instead of multiple columns mess up in one display.

    P.S. On DB2/Windows this settings is set by specifying settings in Properties | Layout | Width parameter.-
    Regards

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    That depends on the terminal width and has nothing to do with DB2 per se. CLP just wraps lines to the terminal width. Properties of the text terminal are set with the stty command.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jan 2003
    Posts
    1,605
    @n_i, can you please write some sample to set for example 10000 characters per row width?

    I have tried using "stty columns 500" and I see "stty -a" that columns has 500 width columns settings, but "list application all show detail" still has no effect, still multiple columns brake.
    Last edited by grofaty; 02-12-09 at 05:45.

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    What I am doing with long lines is this:
    Code:
    db2 "..." | less -S
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    I have found out excellent program Terminator. It can be downloaded from web page: Terminator

    Terminator is using horizontal bar so no wrapping is set. See how terminal window looks like:
    http://software.jessies.org/terminator/win32-tabs.png
    Regards

  6. #6
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    The easiest was is to redirect the output to a file

    db2 list application show detail > app.out
    Then open the app.out file in your editor [any editor will do, I guess it is gedit in Linux].... the file will be in the path from where you have issued the command.... the '>' operator will basically redirect the output to a file....

    Pls note - this will not work when you're under db2 prompt as > is an OS level operator
    Last edited by nick.ncs; 02-17-09 at 08:32.
    IBM Certified Database Associate, DB2 9 for LUW

  7. #7
    Join Date
    Jan 2003
    Posts
    1,605
    @nick.ncs, I know I can output to file, but this is way too time consuming and files have to be deleted.

    I think this has to be some kind of terminal settings, because Terminator can handle this problem without the need of "output" to file...

  8. #8
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Why don't you just pipe the output into a pager like "less" as I mentioned above?
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  9. #9
    Join Date
    Jan 2003
    Posts
    1,605
    stolze, your solution is great I love it thanks a lot. But Windows way or Terminator way is better it removes additional typing. There is one think I dislike about Terminator, it is written in Java so it takes more time to start up, so it is also time consuming if starting terminal multiple times per day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •