Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to retrive the Indexs of a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to retrive the Indexs of a table
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: 1243
Location: Israel

PostPosted: Wed Aug 16, 2006 8:12 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am
No new posts Adding a userid to SMTP Security table Yolanda Harvey JCL & VSAM 1 Sun Aug 13, 2017 6:16 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us