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

  1. #NAME#
  2. DA_TableDefinitionForeignKeys
  3. #DESCRIPTION#
  4. The foreign keys impact analysis query returns the names of Shareable Table Definitions with foreign keys which are constrained by the Shareable Table Definition identified in the SQL WHERE clause.
  5.  
  6. View type:  DAQTableDefinition
  7.  
  8. Modifications:
  9. Change the search criteria of the tableDefinition using the = (equals), IN or LIKE elements in the SQL WHERE clause.
  10. #MODIFIED#
  11.  
  12. #VERSION#
  13.  
  14. #SQL STATEMENT#
  15. SELECT DISTINCT
  16.   t.tableDefinition,
  17.   pt.tableDefinition as dependentTableDef,
  18.   pk.dependentConstraintName
  19. FROM OUTER
  20.   DAQTableDefinition t,
  21.   (t.hasPrimaryKey) pk,
  22.   (pk.dependentTableDef) pt
  23. WHERE
  24.   t.tableDefinition like '<>%' AND
  25.   EXISTS (SELECT 1
  26.           FROM (t.hasPrimaryKey) pk,
  27.                (pk.dependentTableDef) pt
  28.           WHERE pt.tableDefinition <> '')
  29. ORDER BY
  30.   t.tableDefinition,
  31.   pt.tableDefinition;
  32.