Hi,
Can you please help me that how to find out the unique index column name for a table? Can we know it from some SYSIBM table? Please guide.
How to determine Unique Index column name for a DB2 table?
-
- New Member
- Posts: 7
- Joined: Wed Aug 20, 2014 2:02 pm
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
-
- New Member
- Posts: 7
- Joined: Wed Aug 20, 2014 2:02 pm
Re: How to determine Unique Index column name for a DB2 tabl
Thanks Pandora-Box. The links gives the details about sysibm.sysindexs but can I write an SQL to retrive the columns for the indexes for a table?
-
- Website Team
- Posts: 70
- Joined: Wed Jul 31, 2013 10:19 pm
Re: How to determine Unique Index column name for a DB2 tabl
Hi Rakhee,
Please use below query to find unique index of a table
Regards,
Chandan
Please use below query to find unique index of a table
Code: Select all
SELECT NAME,COLNAME
FROM SYSIBM.SYSINDEXES,SYSIBM.SYSKEYS
WHERE TBNAME='table name'
AND TBCREATOR='creator'
AND UNIQUERULE ='U'
AND NAME= IXNAME
AND IXCREATOR=CREATOR
Chandan
-
- New Member
- Posts: 7
- Joined: Wed Aug 20, 2014 2:02 pm
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute