How to view the table structure in DB2 database
Please help me
Thanks! in Advance
Regards Ambut Bhath
How to view the table structure in DB2 database
Please help me
Thanks! in Advance
Regards Ambut Bhath
to get all tables: (You may want to restrict schema to your schema)
select * from syscat.tables
to get all columns: (where tabname = your_tabname)
select * from syscat.columns
Generally it's easiest to use DESCRIBE.
DESCRIBE TABLE MYSCHEMA.TABLE
or
DESCRIBE INDEXES FOR MYSCHEMA.TABLE SHOW DETAIL
etc.
See the documentation: DESCRIBE command
I got the answer from the sysibm.syscolumns
ie.,
Select distinct(name), ColType, Length from Sysibm.syscolumns where tbname = 'employee'
Thanks!