Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Describe Table

Status
Not open for further replies.

PatelRam

Programmer
Aug 20, 2003
87
US
Hi,

I am trying to describe table with following command

describe table schema_name.table_name

It's giving me following error

DB21033E The command is not valid for databases that reside on DRDA hosts.

The database is on db2 v7.0 on os390.

Could you let me know why ...??

Thanks,
 
While probably not the best way, you will get most of the table attributes by the following;

DESCRIBE SELECT(*) FROM SCHEMA.TABLENAME;
 
A select(*) is not the same as describe. Besides, if it is a large table you will be accessing disk unnecessarily.

Can you go against the system catalog? Then you can try accessing syscat.columns and syscat.keycoluse giving it the tabschema and tabname.
 
The DESCRIBE SELECT * does not actually bring back any data from the table - only displays the attributes of the columns on the table eg.


SELECT * FROM XXXX.XXXXX

SQLDA Information

sqldaid : SQLDA sqldabc: 0 sqln: 37 sqld: 37

Column Information

sqltype sqllen sqlname.data sqlname.length
-------------------- ------ ------------------ --------------
496 INTEGER 4 VERSION 7
452 CHARACTER 8 OWNERID 7
452 CHARACTER 20 TOOLSREL 8
392 TIMESTAMP 26 LASTREFRESHDTTM 15
393 TIMESTAMP 26 LASTCHANGEDTTM 14
452 CHARACTER 1 SECURITY_OPTION 15
496 INTEGER 4 VERSIONRDM 10
496 INTEGER 4 VERSIONBCM 10
496 INTEGER 4 VERSIONXTM 10
 
I must not have read it correctly - and I wasn't aware that it was possible. Thank you for the information - I like it better than describe since it actually gives you the column length in bytes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top