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

  1. #NAME#
  2. DA_DB2390DatabaseContents
  3. #DESCRIPTION#
  4. The DB2/30 Database contents query returns the name of the DB2/390 tables, tablespaces and indexes which are contained in the specified Database name.  It also returns the name of the storage group and bufferpool used by the database.
  5.  
  6. View type:  DAQDB2390Database
  7.  
  8. Modifications:
  9. The query uses a SQL UNION clause to provide a more compact and readable table. In order to change the search criteria, you must change it for each subselect statement in the UNION.  Change the search criteria of the database name using the = (equals), IN or LIKE elements in the SQL WHERE clause.  
  10.  
  11. #MODIFIED#
  12.  
  13. #VERSION#
  14.  
  15. #SQL STATEMENT#
  16. SELECT DISTINCT
  17.   d.db2390Database,
  18.   d.containsTable..db2390Table as contains,
  19.   'Table' as contentType,
  20.   d.usesStoragegroup..db2390Storagegroup,
  21.   d.usesBufferpool..db2390Bufferpool,
  22.   d.inPhysicalDesign..db2390PhysicalDesign,
  23.   d.roShareFlag,
  24.   d.ccsid,
  25.   d.databaseDescription,
  26.   p.lastUpdate,
  27.   p.addDate
  28. FROM OUTER
  29.   DAQDB2390Database d,
  30.   PartView p,
  31.   PartView p1
  32. WHERE
  33.   d.DB2390Database LIKE '<>%' AND
  34.   d.DB2390Database=p.baseName AND
  35.   d.containsTable..db2390Table=p1.baseName AND
  36.   p1.partType='DSRMRDTable' AND
  37.   p.partType='DSRMRDDatabase'
  38. UNION
  39. SELECT DISTINCT
  40.   d.db2390Database,
  41.   d.containsTablespace..db2390Tablespace as contains,
  42.   'Tablespace' as contentType,
  43.   d.usesStoragegroup..db2390Storagegroup,
  44.   d.usesBufferpool..db2390Bufferpool,
  45.   d.inPhysicalDesign..db2390PhysicalDesign,
  46.   d.roShareFlag,
  47.   d.ccsid,
  48.   d.databaseDescription,
  49.   p.lastUpdate,
  50.   p.addDate
  51. FROM OUTER
  52.   DAQDB2390Database d,
  53.   PartView p,
  54.   PartView p1
  55. WHERE
  56.   d.DB2390Database LIKE '<>%' AND
  57.   d.DB2390Database=p.baseName AND
  58.   d.containsTablespace..db2390Tablespace=p1.baseName AND
  59.   p1.partType='DSRMRDTablespace' AND
  60.   p.partType='DSRMRDDatabase'
  61. ORDER BY
  62.   1 ASC,
  63.   3 ASC,
  64.   2 ASC;
  65.   
  66.