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

  1. #NAME#
  2. DA_RelationalCreatorContents
  3. #DESCRIPTION#
  4. The RelationalCreatorContents relationship query returns the names of all DB2/390 tables, views, aliases, and indexes, all DB2 UDB tables, views and indexes, and all Oracle tables, views and indexes which have in the specified creator ID or schema name.
  5.  
  6. View type:  DAQRelationalSystem
  7.  
  8. Modifications:
  9. Change the search criteria of the creatorID using the = (equals), IN or LIKE elements in the WHERE clause .  In order to provide unique CreatorID names, the  creatorID name has the format  <>RelationalSystem::::Creator ID<variation:revision>.  To find all Creator IDs which have a specific name, use the LIKE clause with % before the first of four colons.
  10. #MODIFIED#
  11.  
  12. #VERSION#
  13.  
  14. #SQL STATEMENT#
  15. --DA_RelationalCreatorContents
  16. SELECT DISTINCT
  17.   r.creatorID,
  18.   r.relationalSystem,
  19.   r.db2csTable..db2csTable as relatedObject,
  20.   'DB2 UDB Table' as partType,
  21.   p.lastUpdate,
  22.   p.addDate
  23. FROM OUTER
  24.   DAQRelationalSystem r,
  25.   PartView p
  26. WHERE
  27.   r.creatorID like '<>%::::%' AND
  28.   r.db2csTable..db2csTable=p.baseName AND
  29.   p.partType='DSRORDTable'
  30. UNION
  31. SELECT DISTINCT
  32.   r.creatorID,
  33.   r.relationalSystem,
  34.   r.db2csView..db2csView as relatedObject,
  35.   'DB2 UDB View' as partType,
  36.   p.lastUpdate,
  37.   p.addDate
  38. FROM OUTER
  39.   DAQRelationalSystem r,
  40.   PartView p
  41. WHERE
  42.   r.creatorID like '<>%::::%' AND
  43.   r.db2csView..db2csView=p.baseName AND
  44.   p.partType='DSRORDView'
  45. UNION
  46. SELECT DISTINCT
  47.   r.creatorID,
  48.   r.relationalSystem,
  49.   r.db2csIndex..db2csIndex as relatedObject,
  50.   'DB2 UDB Index' as partType,
  51.   p.lastUpdate,
  52.   p.addDate
  53. FROM OUTER
  54.   DAQRelationalSystem r,
  55.   PartView p
  56. WHERE
  57.   r.creatorID like '<>%::::%' AND
  58.   r.db2csIndex..db2csIndex=p.baseName AND
  59.   p.partType='DSRORDIndex'
  60. UNION
  61. SELECT DISTINCT
  62.   r.creatorID,
  63.   r.relationalSystem,
  64.   r.db2390Table..db2390Table as relatedObject,
  65.   'DB2/390 Table' as partType,
  66.   p.lastUpdate,
  67.   p.addDate
  68. FROM OUTER
  69.   DAQRelationalSystem r,
  70.   PartView p
  71. WHERE
  72.   r.creatorID like '<>%::::%' AND
  73.   r.db2390Table..db2390Table=p.baseName AND
  74.   p.partType='DSRMRDTable'
  75. UNION
  76. SELECT DISTINCT
  77.   r.creatorID,
  78.   r.relationalSystem,
  79.   r.db2390View..db2390View as relatedObject,
  80.   'DB2/390 View' as partType,
  81.   p.lastUpdate,
  82.   p.addDate
  83. FROM OUTER
  84.   DAQRelationalSystem r,
  85.   PartView p
  86. WHERE
  87.   r.creatorID like '<>%::::%' AND
  88.   r.db2390View..db2390View=p.baseName AND
  89.   p.partType='DSRMRDView'
  90. UNION
  91. SELECT DISTINCT
  92.   r.creatorID,
  93.   r.relationalSystem,
  94.   r.db2390Index..db2390Index as relatedObject,
  95.   'DB2/390 Index' as partType,
  96.   p.lastUpdate,
  97.   p.addDate
  98. FROM OUTER
  99.   DAQRelationalSystem r,
  100.   PartView p
  101. WHERE
  102.   r.creatorID like '<>%::::%' AND
  103.   r.db2390Index..db2390Index=p.baseName AND
  104.   p.partType='DSRMRDIndex'
  105. UNION
  106. SELECT DISTINCT
  107.   r.creatorID,
  108.   r.relationalSystem,
  109.   r.db2390AliasSynonym..db2390AliasOrSynonym as relatedObject,
  110.   'DB2/390 Alias/Synonym' as partType,
  111.   p.lastUpdate,
  112.   p.addDate
  113. FROM OUTER
  114.   DAQRelationalSystem r,
  115.   PartView p
  116. WHERE
  117.   r.creatorID like '<>%::::%' AND
  118.   r.db2390AliasSynonym..db2390AliasOrSynonym=p.baseName AND
  119.   p.partType='DSRAlternateName'
  120. UNION
  121. SELECT DISTINCT
  122.   r.creatorID,
  123.   r.relationalSystem,
  124.   r.oracleTable..oracleTable as relatedObject,
  125.   'Oracle Table' as partType,
  126.   p.lastUpdate,
  127.   p.addDate
  128. FROM OUTER
  129.   DAQRelationalSystem r,
  130.   PartView p
  131. WHERE
  132.   r.creatorID like '<>%::::%' AND
  133.   r.oracleTable..oracleTable=p.baseName AND
  134.   p.partType='DSROracleTable'
  135. UNION
  136. SELECT DISTINCT
  137.   r.creatorID,
  138.   r.relationalSystem,
  139.   r.oracleView..oracleView as relatedObject,
  140.   'Oracle View' as partType,
  141.   p.lastUpdate,
  142.   p.addDate
  143. FROM OUTER
  144.   DAQRelationalSystem r,
  145.   PartView p
  146. WHERE
  147.   r.creatorID like '<>%::::%' AND
  148.   r.oracleView..oracleView=p.baseName AND
  149.   p.partType='DSROracleView'
  150. UNION
  151. SELECT DISTINCT
  152.   r.creatorID,
  153.   r.relationalSystem,
  154.   r.oracleIndex..oracleIndex as relatedObject,
  155.   'Oracle Index' as partType,
  156.   p.lastUpdate,
  157.   p.addDate
  158. FROM OUTER
  159.   DAQRelationalSystem r,
  160.   PartView p
  161. WHERE
  162.   r.creatorID like '<>%::::%' AND
  163.   r.oracleIndex..oracleIndex=p.baseName AND
  164.   p.partType='DSROracleIndex'
  165. ORDER BY
  166.   1 ASC,
  167.   4 ASC,
  168.   3 ASC;
  169.