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

  1. #NAME#
  2. DA_DB2390Alias
  3. #DESCRIPTION#
  4. The DB2/390 Alias glossary query returns the name of the DB2/390 table or view which is referenced by the specified Alias name.   
  5.  
  6. View type:  DAQDB2390AliasSynonym
  7.  
  8. Modifications:
  9. Change the search criteria of the alias or synonym name using the = (equals), IN or LIKE elements in the WHERE clause.  The WHERE clause may be changed to locate all Aliases of a specific table or view.
  10.  
  11.  
  12. #MODIFIED#
  13.  
  14.  
  15. #VERSION#
  16.  
  17. #SQL STATEMENT#
  18. SELECT DISTINCT
  19.   a.db2390AliasOrSynonym,
  20.   a.creatorID,
  21.   a.synonymAliasFlag,
  22.   f.db2390Table as forObject,
  23.   'DB2/390 Table' as objectType,
  24.   a.aliasSynonymDescription,
  25.   a.comment,
  26.   a.label,
  27.   p.lastUpdate,
  28.   p.addDate
  29. FROM OUTER
  30.   DAQDB2390AliasSynonym a,
  31.   (a.forDB2390Table) f,
  32.   PartView p,
  33.   PartView pf
  34. WHERE
  35.   a.db2390AliasOrSynonym like '<>%' AND
  36.   a.synonymAliasFlag='A'          AND
  37.   a.db2390AliasOrSynonym=p.baseName AND
  38.   f.db2390Table=pf.baseName AND
  39.   pf.partType='DSRMRDTable'
  40. UNION
  41. SELECT DISTINCT
  42.   a.db2390AliasOrSynonym,
  43.   a.creatorID,
  44.   a.synonymAliasFlag,
  45.   f.db2390View as forObject,
  46.   'DB2/390 View' as objectType,
  47.   a.aliasSynonymDescription,
  48.   a.comment,
  49.   a.label,
  50.   p.lastUpdate,
  51.   p.addDate
  52. FROM OUTER
  53.   DAQDB2390AliasSynonym a,
  54.   (a.forDB2390View) f,
  55.   PartView p,
  56.   PartView pf
  57. WHERE
  58.   a.db2390AliasOrSynonym like '<>%' AND
  59.   a.synonymAliasFlag='A'          AND
  60.   a.db2390AliasOrSynonym=p.baseName AND
  61.   f.db2390View=pf.baseName AND
  62.   pf.partType='DSRMRDView'
  63. ORDER BY
  64.   1 ASC;
  65.