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 > db2 command line processor output format

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Oct 2002
Location: Greece
Posts: 8
db2 command line processor output format


I am using db2 command to query my database and when it outputs results it automaticaly consumes space from the screen according to max length of each column.
Is there a way to suppress the output to use only space for the usefull data as it happens with mysql command line client.

Thank you!
Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Oct 2001
Location: Bangalore
Posts: 186

There are very few options but i can give some suggestions:

1.Say your query is:
Select lastname from emp;

If you have length of column lastname as varchar(120), but lastname can be at the most of 30 bytes length, so you can modify the query as:

Select char(lastname,30) from emp;

This will truncate your additional space. Similarly for a double column you can use integer.

2. You can also save the data in form of csv and view it in excel.

Select * from emp > emp.csv

Reply With Quote

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