home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / datatl25.zip / DCTDSGN.Z / EWSQD2IG.QRY < prev    next >
Text File  |  1997-09-11  |  1KB  |  40 lines

  1. #NAME#
  2. DA_DB2udbIndexGlossary
  3. #DESCRIPTION#
  4. The index glossary query returns name of the indexed table and the columns used by the index referenced by the specified name.   
  5.  
  6. View type:  DAQDB2csIndex
  7.  
  8. Modifications:
  9. Change the search criteria of the index name using the = (equals), IN or LIKE elements in the SQL WHERE clause.  The WHERE clause may be changed to locate all indexes which match the specified characteristics. In order to provide unique DB2 UDB index names, the name has the format <>RelSystem:Schema:Database::IndexName<variation:revision>.
  10.  
  11. To find all DB2 UDB indexes which have a specific simple name, use the LIKE clause with % as any of the first three qualifiers.  To speed up your query, use % to include the colons and separators.  For example, if you want all indexes starting "CUST", specify LIKE '%::CUST%'.
  12.                                 
  13.  
  14. #MODIFIED#
  15.  
  16. #VERSION#
  17.  
  18. #SQL STATEMENT#
  19. --DA_DB2udbIndexGlossary
  20. SELECT DISTINCT
  21.   i.db2csIndex,
  22.   i."schema",
  23.   i.inRelationalSystem..relationalSystem,
  24.   i.inPhysicalDesign..db2csPhysicalDesign,
  25.   i.inDatabase..db2csDatabase,
  26.   i.forTable..db2csTable,
  27.   k.keyColumnName,
  28.   k.ascDescFlag,
  29.   i.uniqueFlag,
  30.   p.lastUpdate
  31. FROM
  32.   DAQDB2csIndex i,
  33.   (i.usesKeyDefinition) k,
  34.   PartView p
  35. WHERE
  36.   i.db2csIndex LIKE '<>%' AND
  37.   i.db2csIndex=p.baseName
  38. ORDER BY
  39.   i.db2csIndex
  40.