467,198 Members | 1,207 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,198 developers. It's quick & easy.

describe command

Is it possible to get just the type length from a describe command in db2?
Jul 23 '07 #1
  • viewed: 2280
Share:
3 Replies
plz explain ur query....
Aug 14 '07 #2
Purple
Expert 256MB
Moved from Articles

Moderator
Aug 15 '07 #3
I'm assuming you want the field lengths for each of the columns (rather like the Oracle VSIZE function).

Don't think the DESCRIBE command can do this. However there is a way to get what you require.

If you are describing a table then:

Expand|Select|Wrap|Line Numbers
  1. select colname, length from syscat.columns where tabschema = 'SYSIBM' and tabname = 'SYSTABLES' order by colno 
If you are describing a statement, it's a little more awkward:

Expand|Select|Wrap|Line Numbers
  1. create view abc as <select statement>
  2.  
  3. select colname, length from syscat.columns where tabschema = USER and tabname = 'ABC' order by colno
  4.  
  5. drop view abc
Aug 16 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by _link98@yahoo.com | last post: by
1 post views Thread by Constantin Khatsckevich | last post: by
12 posts views Thread by Serman D. | last post: by
8 posts views Thread by cbtguy_2000 | last post: by
2 posts views Thread by account locked | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.