|
View previous topic :: View next topic
|
| Author |
Message |
BAJJI
New User

Joined: 15 Jul 2005 Posts: 47
|
|
|
|
Hi all,
Can U tell me what query shud I fire in order to get the schema of Table???
I have the table name and need to know the datatypes and fields of that and keys if any exixt?
thanks
kiran |
|
| Back to top |
|
 |
khamarutheen
Active Member

Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Hi kiran,
Try with SYSIBM.SYSTABLES or SYSIBM.SYSCOLUMNS. Hope u can get the field description there. |
|
| Back to top |
|
 |
BAJJI
New User

Joined: 15 Jul 2005 Posts: 47
|
|
|
|
hi kamarutheen,
can u pls write down the query.
thanks
kiran. |
|
| Back to top |
|
 |
khamarutheen
Active Member

Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Hi Kiran,
Use this query:
| Quote: |
| Note: Use this query in QMF environment only. |
| Code: |
SELECT * FROM SYSIBM.SYSTABLES;
SELECT * FROM SYSIBM.SYSCOLUMNS;
|
|
|
| Back to top |
|
 |
BAJJI
New User

Joined: 15 Jul 2005 Posts: 47
|
|
|
|
hi khamarutheen,
I wanted to know what query shud I write in order to get the schema of a given table with table name EMPTABLE.
I need to know the datatypes and fields of that and keys if any exist for this one.
can you please write down the query.
thanks,
Kiran |
|
| Back to top |
|
 |
BAJJI
New User

Joined: 15 Jul 2005 Posts: 47
|
|
|
|
Hi,
I found out and here comes the answer...
SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBNAME LIKE 'EMPTABLE'
In this, all the column names are displayed Row-wise
Regarding keys, we can get the info from the column named NULLS
thanks,
Kiran. |
|
| Back to top |
|
 |
|
|