If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to set ouput of terminal when using list application command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-09, 04:49
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #2 (permalink)  
Old 02-11-09, 09:03
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
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.
Reply With Quote
  #3 (permalink)  
Old 02-12-09, 02:26
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
@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 04:45.
Reply With Quote
  #4 (permalink)  
Old 02-12-09, 06:22
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
What I am doing with long lines is this:
Code:
db2 "..." | less -S
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 02-15-09, 03:04
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #6 (permalink)  
Old 02-17-09, 07:17
nick.ncs nick.ncs is offline
Registered User
 
Join Date: May 2007
Location: somewhere in dbforums
Posts: 221
The easiest was is to redirect the output to a file

Quote:
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
__________________
IBM Certified Database Associate, DB2 9 for LUW

Last edited by nick.ncs; 02-17-09 at 07:32.
Reply With Quote
  #7 (permalink)  
Old 02-17-09, 08:06
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
@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...
Reply With Quote
  #8 (permalink)  
Old 02-17-09, 15:42
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #9 (permalink)  
Old 02-18-09, 02:24
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On