HI All,

I need to create SQL queries to get Constraints and Indexes from DB2 system catalog tables.

Can any one help me out to get sql queries for listed below containts.

1. IDENTIFYING PRIMARY KEY CONSTRAINTS
2. IDENTIFYING PRIMARY KEY INDEXES
3. IDENTIFYING FOREIGN KEY CONSTRAINTS
4. IDENTIFYING FOREIGN KEY INDEXES


For example I have created one query to get Primary Key Constraints , like this I need quries for mentioned above containts.

SELECT SUBSTR(A.TBNAME,1,20) AS "TABLE NAME",
SUBSTR(A.COLNAME,1,20) AS "COLUMN NAME",
SUBSTR(A.RELNAME,1,20) AS "RELATION NAME"
FROM SYSIBM.SYSFOREIGNKEYS A, SYSIBM.SYSRELS B
WHERE A.TBNAME= B.REFTBNAME;


Thanks & Regards,
Manish