By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,851 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,851 IT Pros & Developers. It's quick & easy.

describe command

P: 1
Is it possible to get just the type length from a describe command in db2?
Jul 23 '07 #1
Share this Question
Share on Google+
3 Replies

P: 14
plz explain ur query....
Aug 14 '07 #2

Expert 100+
P: 404
Moved from Articles

Aug 15 '07 #3

P: 57
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>
  3. select colname, length from syscat.columns where tabschema = USER and tabname = 'ABC' order by colno
  5. drop view abc
Aug 16 '07 #4

Post your reply

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