IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to retrive the Indexs of a table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sanisumi

New User


Joined: 01 Aug 2006
Posts: 2

PostPosted: Wed Aug 16, 2006 6:18 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Aug 16, 2006 8:12 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top