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

  1. #NAME#
  2. DA_TableDefinitionUsage
  3. #DESCRIPTION#
  4. The Table Definition Usage impact analysis query returns the names of all DB2/390 and DB2 UDB and Oracle tables which directly use a Shareable Table Definition and may be impacted by changes to its specification.  DB2/390 tables are of partType DSRMRDTable.  DB2 UDB tables are of partType DSRORDTable. Oracle tables are of partType DSROracleTable.
  5.  
  6. View type:  DAQTableDefinitionUsage
  7.  
  8. Modifications:
  9. This query uses a SQL UNION clause to make a more compact and readable table.  To change the search criteria you must change it in each of the subselect statments. Qualify the tableDefinition name using the = (equals), IN or LIKE elements in the SQL WHERE clause.
  10. #MODIFIED#
  11.  
  12. #VERSION#
  13.  
  14. #SQL STATEMENT#
  15. --DA_TableDefinitionUsage
  16. -- DB2/390 Tables
  17. SELECT DISTINCT
  18.   t.tableDefinition,
  19.   'DB2/390 Table' as tableType,
  20.   m.db2390Table as tableName 
  21. FROM OUTER
  22.   DAQTableDefinitionUsage t,
  23.   (t.definesDB2390Table) m,
  24.   PartView p
  25. WHERE
  26.   t.tableDefinition like '<>%' AND
  27.   m.db2390Table=p.baseName AND
  28.   p.partType='DSRMRDTable'
  29. UNION
  30. -- DB2 for common server tables
  31. SELECT DISTINCT
  32.   t.tableDefinition,
  33.   'DB2 UDB Table' as tableType,
  34.   m.db2csTable  as tableName
  35. FROM OUTER
  36.   DAQTableDefinitionUsage t,
  37.   (t.definesDB2csTable) m,
  38.   PartView p
  39. WHERE
  40.   t.tableDefinition like '<>%' AND
  41.   m.db2csTable=p.baseName AND
  42.   p.partType='DSRORDTable'
  43. UNION
  44. -- Oracle tables
  45. SELECT DISTINCT
  46.   t.tableDefinition,
  47.   'Oracle Table' as tableType,
  48.   m.oracleTable as tableName 
  49. FROM OUTER
  50.   DAQTableDefinitionUsage t,
  51.   (t.definesOracleTable) m,
  52.   PartView p
  53. WHERE
  54.   t.tableDefinition like '<>%' AND
  55.   m.oracleTable=p.baseName AND
  56.   p.partType='DSROracleTable'
  57. ORDER BY
  58.   1,2,3;
  59.