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 > formatting query result in db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-03, 09:26
downtown downtown is offline
Registered User
 
Join Date: Dec 2003
Location: Italy
Posts: 11
Question formatting query result in db2

Anybody knows how to format queries result in db2 using clp for instance? as in oracle?

Rosario
Reply With Quote
  #2 (permalink)  
Old 12-09-03, 09:32
downtown downtown is offline
Registered User
 
Join Date: Dec 2003
Location: Italy
Posts: 11
formatting.. 2nd part

..for example in oracle sqlplus was the column command allowing the formatting of columns in result queries

ex: col table_name format a10

does exists something similar in db2 or in some of its tools?
It is possible so to have a more readble and ordered result queries?

Thanks again
Rosario
Reply With Quote
  #3 (permalink)  
Old 12-09-03, 11:56
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: formatting.. 2nd part

Quote:
Originally posted by downtown
..for example in oracle sqlplus was the column command allowing the formatting of columns in result queries

ex: col table_name format a10

does exists something similar in db2 or in some of its tools?
It is possible so to have a more readble and ordered result queries?

Thanks again
Rosario
The answer is no. You can't format query output using CLP, as you would in Oracle's SQLplus. However, you could use string functions to accomplish what you need. E.g. instead of

COL TABLE_NAME FORMAT A10

you could use

SUBSTR(TABLE_NAME, 1, 10)

which will result in a string right-padded with blanks to the length of 10 characters.
Reply With Quote
  #4 (permalink)  
Old 12-09-03, 12:01
downtown downtown is offline
Registered User
 
Join Date: Dec 2003
Location: Italy
Posts: 11
thanx much n_i
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