Is it possible to get just the type length from a describe command in db2?
describe command
Collapse
X
-
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:
If you are describing a statement, it's a little more awkward:Code:select colname, length from syscat.columns where tabschema = 'SYSIBM' and tabname = 'SYSTABLES' order by colno
Code:create view abc as <select statement> select colname, length from syscat.columns where tabschema = USER and tabname = 'ABC' order by colno drop view abc
Comment
Comment