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

  1. #NAME#
  2. DA_DB2udbTablespaceGlossary
  3. #DESCRIPTION#
  4. The DB2 UDB tablespace glossary query returns the tables contained in the tablespaces which are specified by the WHERE clause.  
  5.  
  6. View type:  DAQDB2csTablespace
  7.  
  8. Modifications:
  9. Change the search criteria of the tablespace name using the = (equals), IN or LIKE elements in the SQL WHERE clause.  The WHERE clause may be changed to locate all Tablespaces which contain a specific table.                                       
  10.  
  11. #MODIFIED#
  12.  
  13. #VERSION#
  14.  
  15. #SQL STATEMENT#
  16. --DA_DB2udbTablespaceGlossary
  17. SELECT DISTINCT
  18.   ts.db2csTablespace,
  19.   t.db2csTable as "table",
  20.   'primary tablespace' as purpose,
  21.   ts.inRelationalSystem..relationalSystem,
  22.   p.addDate,
  23.   p.lastUpdate
  24. FROM
  25.   DAQDB2csTablespace ts,
  26.   (ts.containsTable) t,
  27.   PartView p
  28. WHERE
  29.   ts.db2csTablespace LIKE '<>%' AND
  30.   ts.db2csTablespace=p.baseName AND
  31.   p.partType='DSRORDTablespace' AND
  32.   t.db2csTable <> ''
  33. UNION
  34. SELECT DISTINCT
  35.   ts.db2csTablespace,
  36.   t.db2csTable as "table",
  37.   'index tablespace' as purpose,
  38.   ts.inRelationalSystem..relationalSystem,
  39.   p.addDate,
  40.   p.lastUpdate
  41. FROM
  42.   DAQDB2csTablespace ts,
  43.   (ts.containsIndexForTable) t,
  44.   PartView p
  45. WHERE
  46.   ts.db2csTablespace LIKE '<>%' AND
  47.   ts.db2csTablespace=p.baseName AND
  48.   p.partType='DSRORDTablespace' AND
  49.   t.db2csTable <> ''
  50. UNION
  51. SELECT DISTINCT
  52.   ts.db2csTablespace,
  53.   t.db2csTable as "table",
  54.   'LOB tablespace' as purpose,
  55.   ts.inRelationalSystem..relationalSystem,
  56.   p.addDate,
  57.   p.lastUpdate
  58. FROM
  59.   DAQDB2csTablespace ts,
  60.   (ts.containsLOBForTable) t,
  61.   PartView p
  62. WHERE
  63.   ts.db2csTablespace LIKE '<>%' AND
  64.   ts.db2csTablespace=p.baseName AND
  65.   p.partType='DSRORDTablespace' AND
  66.   t.db2csTable <> ''
  67. ORDER BY
  68.   1,3;
  69.