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

How to find how many columns are indexed in a table


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

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Thu Jul 21, 2005 2:19 pm
Reply with quote

In a table there is lot of cloumns.how will we find how many columns are indexed.
what is the way to find out indexing columns.
Back to top
View user's profile Send private message
shobam

New User


Joined: 18 Jul 2005
Posts: 34
Location: CN

PostPosted: Fri Jul 22, 2005 11:11 am
Reply with quote

To get the list of all indexes in a table , Try this SQL statement

SELECT *
FROM SYSIBM.SYSINDEXES
WHERE TBNAME = 'TableName'
AND TBCREATOR = 'CreatorName';

Please correct me If I am wrong.
Back to top
View user's profile Send private message
ragshere

New User


Joined: 20 Dec 2004
Posts: 70

PostPosted: Thu Jul 28, 2005 6:05 pm
Reply with quote

Hi,
Querying SYSINDEXES Table will provide only the index name and its property(unique,duplicate).
You have to query SYSKEYS table with the index name to know the columns included in that index.
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 Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top