View previous topic :: View next topic
|
Author |
Message |
sanisumi
New User
Joined: 01 Aug 2006 Posts: 2
|
|
|
|
Hi,
I would like to know how to retrive indexes of a table.
i had gone through some of the previous posts and found only one information.
SYSIBM.SYSKEYS
is the table. it has following columns
Code:
IXNAME VARCHAR(18)
IXCREATOR CHAR(8)
COLNAME VARCHAR(18)
COLNO SMALLINT
COLSEQ SMALLINT
ORDERING CHAR(1)
IBMREQD CHAR(1)
I do not know the index names. The only information i have is the table name. Let me know if some has any idea on this. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
The table containing the indexes is SYSIBM.SYSINDEXES:
Code: |
SELECT * FROM SYSIBM.SYSINDEXES
WHERE TBNAME = 'tablename' |
You receive one row for each index with a lot of nice information!
From there you can reach SYSIBM.SYSKEYS:
Code: |
SELECT * FROM SYSIBM.SYSKEYS
WHERE IXNAME IN (SELECT NAME
FROM SYSIBM.SYSINDEXES
WHERE TBNAME = 'tablename')
ORDER BY IXNAME,COLSEQ |
|
|
Back to top |
|
|
|