home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / datatl25.zip / DCTDSGN.Z / ewsqifg.qry < prev    next >
Text File  |  1997-09-12  |  3KB  |  125 lines

  1. #NAME#
  2. DA_IMSfieldData
  3. #DESCRIPTION#
  4. This query collects information about fields in IMS DBDs.
  5.  
  6. Modifications:
  7. Change the search criteria of the dbd name in the SQL WHERE clause to get fields in one DBD.
  8. Use 
  9. WHERE d.segmName = "<DBD1>SEG1<var:rev>" to find fields in the segment named SEG1 in DBD named DBD1.
  10.  
  11. Note:
  12. There are four possible paths to find the data characteristics of the field, depending on whether DSField uses a shared DSDataItem or a local DSDataItem, and on whether the DSDataItem uses a DSSimpleTypeDef directly, or goes through a shareable Data
  13. Element.
  14. d.typeCode will contain the data type code for a field using a local dataItem with a simpleTypeDef
  15. se.typeCode will contain the data type code when the local dataItem has a shareable DataElement.
  16. ms.typeCode will contain the data type code when the shared dataItem has a simpleTypeDef.
  17. me.typeCode will contain the data type code when the shared dataItem has a shareable DataElement.
  18.  
  19. View type:  DAQmsdbDBD
  20.  
  21. #MODIFIED#
  22.  
  23. #VERSION#
  24.  
  25. #SQL STATEMENT#
  26. SELECT DISTINCT
  27.   d.fieldName,
  28.   se.dataElement as elementName,
  29.   d.sequenceField, 
  30.   d.uniqueSequence,
  31.   d.offsetFromLevel01,
  32.   d.typeCode as "type",
  33.   d.asBitData as "isBitData",
  34.   d.numericPrecision as "precision",
  35.   d.strLength as "length",
  36.   d.fieldLabel,
  37.   d.fieldDescription
  38. FROM OUTER
  39.   DAQmsdbDBD d,
  40.   (d.pSharedElement) se
  41. WHERE
  42. -- also change the DBD name in the next WHERE clauses
  43.   d.dbdName LIKE '<>%' 
  44.   
  45. UNION
  46.  
  47. SELECT DISTINCT
  48.   d.fieldName,
  49.   se.dataElement as elementName, 
  50.   d.sequenceField, 
  51.   d.uniqueSequence,
  52.   d.offsetFromLevel01,
  53.   se.typeCode as "type", 
  54.   se.asBitData as "isBitData", 
  55.   se.numericPrecision as "precision", 
  56.   se.stringLength as "length", 
  57.   d.fieldLabel,
  58.   d.fieldDescription
  59. FROM OUTER
  60.   DAQmsdbDBD d,
  61.   (d.pSharedElement) se
  62. WHERE
  63. -- also change the DBD name in the other WHERE clauses
  64.   d.dbdName LIKE '<>%'
  65. AND 
  66.   d.pSharedElement IS NOT NULL
  67.  
  68. UNION
  69.  
  70. SELECT DISTINCT
  71.   d.fieldName,
  72.   me.elementName as elementName, 
  73.   d.sequenceField, 
  74.   d.uniqueSequence,
  75.   d.offsetFromLevel01,
  76.   me.typeCode as "type", 
  77.   me.asBitData as "isBitData", 
  78.   me.numericPrecision as "precision", 
  79.   me.stringLength as "length", 
  80.   d.fieldLabel,
  81.   d.fieldDescription
  82. FROM OUTER
  83.   DAQmsdbDBD d,
  84.   (d.mappingStruct) ms,
  85.   (ms.usesDataElement) me, 
  86.   (ms.imsFieldName) dea
  87. WHERE
  88. -- also change the DBD name in the other WHERE clauses
  89.   d.dbdName LIKE '<>%' 
  90. AND
  91.   d.fieldName = dea.elementAlias
  92. AND 
  93.   d.mappingStruct IS NOT NULL
  94. AND 
  95.   ms.usesDataElement IS NOT NULL
  96.  
  97. UNION
  98.  
  99. SELECT DISTINCT
  100.   d.fieldName,
  101.   me.elementName as elementName, 
  102.   d.sequenceField, 
  103.   d.uniqueSequence,
  104.   d.offsetFromLevel01,
  105.   ms.dataTypeCode as "type", 
  106.   ms.asBitData as "isBitData", 
  107.   ms."precision" as "precision", 
  108.   ms.stringLength as "length", 
  109.   d.fieldLabel,
  110.   d.fieldDescription
  111. FROM OUTER
  112.   DAQmsdbDBD d, 
  113.   (d.mappingStruct) ms, 
  114.   (ms.usesDataElement) me, 
  115.   (ms.imsFieldName) dea
  116. WHERE
  117. -- also change the DBD name in the previous WHERE clauses
  118.   d.dbdName LIKE '<>%' 
  119. AND
  120.   d.fieldName = dea.elementAlias
  121. AND 
  122.   d.mappingStruct IS NOT NULL
  123.  
  124. ORDER BY 1 ASC
  125.