Describe a Table



IBM's flagship relational database management system

Describe a Table

Postby eprasad629 » Wed Jul 22, 2009 5:12 pm

Hi,

Good day!!!

I would like to know the query which will describe a table's structure.

I have done this in SQL Plus through DESC <table-name> command. However, this doesn't works out in DB2-SQL. Though RC-Manager could describe the structure of a table; I want to attain this through a query.

Could you please suggest me a solution?

Many thanks in advance.
Thanks & Regards,

Praelay
--------------------------------
eprasad629
 
Posts: 34
Joined: Wed Jan 07, 2009 12:48 pm
Location: Bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: Describe a Table

 

Re: Describe a Table

Postby swd » Wed Jul 22, 2009 5:33 pm

For DB2 you can find a tables structure eith by looking at the DDL or the DCLGEN or you can query the DB2 catalog with something like this

SELECT *
FROM SYSIBM.SYSCOLUMNS
WHERE TBNAME = 'TABLENAME'
AND TBCREATOR = 'CREATORNAME'
ORDER BY COLNO
;

This should give you something similar to the Oracle DESC output.
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post