Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    Greece
    Posts
    8

    db2 command line processor output format

    Hello

    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!
    Gaganis

  2. #2
    Join Date
    Oct 2001
    Location
    Bangalore
    Posts
    186
    Hi,

    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

    Cheers,
    Prashant

Posting Permissions

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