twissi
Active User
Joined: 01 Aug 2005 Posts: 105 Location: Somerset, NJ
|
|
|
|
Suman,
To find the primary key of a table in a particular database:
Code: |
SELECT NAME FROM SYSIBM.SYSINDEXES WHERE TBNAME='your_table_name'
AND TBCREATOR ='your_database_name' AND UNIQUERULE='P' |
To find the length of each field:
Code: |
SELECT NAME,COLTYPE,LENGTH FROM SYSIBM.SYSCOLUMNS WHERE TBNAME='your_table_name' AND TB
CREATOR='your_database_name' ORDER BY COLNO |
Cheers, Twissi. |
|