CREATE VIEW DAQPCB AS 
  SELECT
    a.*,
    b.list,
    f.name as pcbName,
    l.contents as pcbDescription,
    l.label as pcbDescType,
    q.compatibility,
    q.hpPSBName,
    q.ioaSize,
    q.ioErrorOption,
    q.language,
    q.maximumQxCalls,
    q.onlineImageCopy,
    q.ssaSize,
    q.writeToOperator,
    u.name as psbName,
    ad.name as basedOnDBD,
    ah.procoptPCB,
    ap.name as baseDBDname,
    au.keyLength,
    au.positioning,
    av.procoptPCB as procoptPCBdb,
    bi.name as sequenceDBDname,
    au.sequentialBufferng,
    bn.procoptSENSEG,
    bn.subsetPointer1,
    bn.subsetPointer2,
    bn.subsetPointer3,
    bn.subsetPointer4,
    bn.subsetPointer5,
    bn.subsetPointer6,
    bn.subsetPointer7,
    bn.subsetPointer8,
    cb.name as indexDBDname,
    cn.name as structureAlias
  FROM
    OIDOVers a
    INNER JOIN DSPCB_version b ON a.OID=b.OID AND a.OVer=b.OVer
    INNER JOIN FHCVersion c ON c.OID=b.OID AND c.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN ADLink_target m ON m.classAttr='DSPCB_version.usingPSBs' AND
      m.targetOID=b.OID AND m.targetOVer=b.OVer
    LEFT OUTER JOIN adobjectFind n ON n.OID=m.relOID AND n.OVer=m.relOVer AND
       n.className='DSIncludesPCB' AND
       n.contextRelease=a.contextRelease AND n.contextName=a.contextName
    LEFT OUTER JOIN ADLink o ON o.OID=n.OID AND o.OVer=n.OVer
    LEFT OUTER JOIN ADLink_source v ON v.classAttr='FHCVersion.dependsOn' AND
      v.sourceOID=c.OID AND v.sourceOVer=c.OVer
    LEFT OUTER JOIN adobjectFind w ON w.OID=v.relOID AND w.OVer=v.relOVer AND
       w.className='ADLinkTCPartDependsOnTCPart' AND
       w.contextRelease=a.contextRelease AND w.contextName=a.contextName
    LEFT OUTER JOIN ADLink x ON x.OID=w.OID AND x.OVer=w.OVer
    LEFT OUTER JOIN adobjectFind ae ON ae.OID=b.typeOfPCB AND
       ae.className='DSSpecifiedByType' AND
       ae.contextRelease=a.contextRelease AND ae.contextName=a.contextName
    LEFT OUTER JOIN ADLink af ON af.OID=ae.OID AND af.OVer=ae.OVer
    LEFT OUTER JOIN adobjectFind aq ON aq.OID=b.typeOfPCB AND
       aq.className='DSSpecifiedByType' AND
       aq.contextRelease=a.contextRelease AND aq.contextName=a.contextName
    LEFT OUTER JOIN ADLink ar ON ar.OID=aq.OID AND ar.OVer=aq.OVer
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSPCB_version'
    LEFT OUTER JOIN OIDOVers p ON p.OID=o.adSource AND  p.contextOID=a.contextOID
    LEFT OUTER JOIN DSPSB_version q ON q.OID=o.adSource AND q.OVer=p.OVer
    LEFT OUTER JOIN TCVersionClass s ON s.OID=q.OID AND s.OVer=q.OVer
    LEFT OUTER JOIN OIDOVers y ON y.OID=x.adTarget AND  y.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass ab ON ab.OID=x.adTarget AND ab.OVer=x.OVer
    LEFT OUTER JOIN adobjectFind ag ON ag.OID=af.adTarget AND
       ag.className='DSPCBbased' AND
       ag.contextRelease=a.contextRelease AND ag.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind at ON at.OID=ar.adTarget AND
       at.className='DSPCBdb' AND
       at.contextRelease=a.contextRelease AND at.contextName=a.contextName
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN TCSourceObject t ON t.OID=s.osrelTCSourceObjct
    LEFT OUTER JOIN TCSourceObject ac ON ac.OID=ab.osrelTCSourceObjct
    LEFT OUTER JOIN DSPCBbased ah ON ah.OID=ag.OID AND ah.OVer=ag.OVer
    LEFT OUTER JOIN DSPCBdb au ON au.OID=at.OID AND au.OVer=at.OVer
    LEFT OUTER JOIN DSPCBbased av ON av.OID=au.OID AND av.OVer=au.OVer
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN FHCPath u ON u.OID=t.osrelNuPathId
    LEFT OUTER JOIN FHCPath ad ON ad.OID=ac.osrelNuPathId
    LEFT OUTER JOIN adobjectFind ai ON ai.OID=ah.baseDBD AND
       ai.className='DSBasedOn' AND
       ai.contextRelease=a.contextRelease AND ai.contextName=a.contextName
    LEFT OUTER JOIN ADLink aj ON aj.OID=ai.OID AND aj.OVer=ai.OVer
    LEFT OUTER JOIN adobjectFind aw ON aw.OID=au.procseq AND
       aw.className='DSSequencedBy' AND
       aw.contextRelease=a.contextRelease AND aw.contextName=a.contextName
    LEFT OUTER JOIN ADLink ax ON ax.OID=aw.OID AND ax.OVer=aw.OVer
    LEFT OUTER JOIN ADLink_source bj ON bj.classAttr='DSPCBdb.senseg' AND
      bj.sourceOID=au.OID AND bj.sourceOVer=au.OVer
    LEFT OUTER JOIN adobjectFind bk ON bk.OID=bj.relOID AND bk.OVer=bj.relOVer AND
       bk.className='DSHasSensitive' AND
       bk.contextRelease=a.contextRelease AND bk.contextName=a.contextName
    LEFT OUTER JOIN ADLink bl ON bl.OID=bk.OID AND bl.OVer=bk.OVer
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer
    LEFT OUTER JOIN OIDOVers ak ON ak.OID=aj.adTarget AND  ak.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass an ON an.OID=aj.adTarget AND an.OVer=aj.OVer
    LEFT OUTER JOIN adobjectFind ay ON ay.OID=ax.adTarget AND
       ay.className='DSDBDindex' AND
       ay.contextRelease=a.contextRelease AND ay.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind bm ON bm.OID=bl.adTarget AND
       bm.className='DSSenSegment' AND
       bm.contextRelease=a.contextRelease AND bm.contextName=a.contextName
    LEFT OUTER JOIN TCSourceObject ao ON ao.OID=an.osrelTCSourceObjct
    LEFT OUTER JOIN DSDBDaccess ba ON ba.OID=ay.OID AND ba.OVer=ay.OVer
    LEFT OUTER JOIN DSSenSegment bn ON bn.OID=bm.OID AND bn.OVer=bm.OVer
    LEFT OUTER JOIN FHCPath ap ON ap.OID=ao.osrelNuPathId
    LEFT OUTER JOIN adobjectFind bb ON bb.OID=ba.containingDBD AND
       bb.className='DSDefinedByAccess' AND
       bb.contextRelease=a.contextRelease AND bb.contextName=a.contextName
    LEFT OUTER JOIN ADLink bc ON bc.OID=bb.OID AND bc.OVer=bb.OVer
    LEFT OUTER JOIN ADLink_source bo ON bo.classAttr='DSSenSegment.indices' AND
      bo.sourceOID=bn.OID AND bo.sourceOVer=bn.OVer
    LEFT OUTER JOIN adobjectFind bp ON bp.OID=bo.relOID AND bp.OVer=bo.relOVer AND
       bp.className='DSIndexedBy' AND
       bp.contextRelease=a.contextRelease AND bp.contextName=a.contextName
    LEFT OUTER JOIN ADLink bq ON bq.OID=bp.OID AND bq.OVer=bp.OVer
    LEFT OUTER JOIN adobjectFind cc ON cc.OID=bn.targetSegment AND
       cc.className='DSMapsTo' AND
       cc.contextRelease=a.contextRelease AND cc.contextName=a.contextName
    LEFT OUTER JOIN ADLink cd ON cd.OID=cc.OID AND cd.OVer=cc.OVer
    LEFT OUTER JOIN OIDOVers bd ON bd.OID=bc.adSource AND  bd.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass bg ON bg.OID=bc.adSource AND bg.OVer=bc.OVer
    LEFT OUTER JOIN adobjectFind br ON br.OID=bq.adTarget AND
       br.className='DSDBDindex' AND
       br.contextRelease=a.contextRelease AND br.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind ce ON ce.OID=cd.adTarget AND
       ce.className='DSSegment' AND
       ce.contextRelease=a.contextRelease AND ce.contextName=a.contextName
    LEFT OUTER JOIN TCSourceObject bh ON bh.OID=bg.osrelTCSourceObjct
    LEFT OUTER JOIN DSDBDaccess bt ON bt.OID=br.OID AND bt.OVer=br.OVer
    LEFT OUTER JOIN DSSegment cf ON cf.OID=ce.OID AND cf.OVer=ce.OVer
    LEFT OUTER JOIN FHCPath bi ON bi.OID=bh.osrelNuPathId
    LEFT OUTER JOIN adobjectFind bu ON bu.OID=bt.containingDBD AND
       bu.className='DSDefinedByAccess' AND
       bu.contextRelease=a.contextRelease AND bu.contextName=a.contextName
    LEFT OUTER JOIN ADLink bv ON bv.OID=bu.OID AND bv.OVer=bu.OVer
    LEFT OUTER JOIN adobjectFind cg ON cg.OID=cf.segmName AND
       cg.className='DSHasIMSsegmName' AND
       cg.contextRelease=a.contextRelease AND cg.contextName=a.contextName
    LEFT OUTER JOIN ADLink ch ON ch.OID=cg.OID AND ch.OVer=cg.OVer
    LEFT OUTER JOIN OIDOVers bw ON bw.OID=bv.adSource AND  bw.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass bz ON bz.OID=bv.adSource AND bz.OVer=bv.OVer
    LEFT OUTER JOIN OIDOVers ci ON ci.OID=ch.adTarget AND  ci.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass cl ON cl.OID=ch.adTarget AND cl.OVer=ch.OVer
    LEFT OUTER JOIN TCSourceObject ca ON ca.OID=bz.osrelTCSourceObjct
    LEFT OUTER JOIN TCSourceObject cm ON cm.OID=cl.osrelTCSourceObjct
    LEFT OUTER JOIN FHCPath cb ON cb.OID=ca.osrelNuPathId
    LEFT OUTER JOIN FHCPath cn ON cn.OID=cm.osrelNuPathId;

CREATE VIEW DAQDBDAccess AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    l.contents as dbdDescription,
    l.label as dbdDescType,
    p.dliAccess,
    p.osAccess,
    p.passwordFlag,
    s.dsDevice,
    s.dsModel,
    v.ddsName
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind m ON m.OID=b.dliAccess AND
       m.className='DSDefinedByAccess' AND
       m.contextRelease=a.contextRelease AND m.contextName=a.contextName
    LEFT OUTER JOIN ADLink n ON n.OID=m.OID AND n.OVer=m.OVer
    LEFT OUTER JOIN ADLink_source q ON q.classAttr='DSDBD_version.datasets' AND
      q.sourceOID=b.OID AND q.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind r ON r.OID=q.relOID AND r.OVer=q.relOVer AND
       r.className='DSDSColl' AND
       r.contextRelease=a.contextRelease AND r.contextName=a.contextName
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSDBD_version'
    LEFT OUTER JOIN adobjectFind o ON o.OID=n.adTarget AND
       o.className='DSDBDaccess' AND
       o.contextRelease=a.contextRelease AND o.contextName=a.contextName
    LEFT OUTER JOIN DSDSColl s ON s.OID=r.OID AND s.OVer=r.OVer
    LEFT OUTER JOIN ADLink t ON t.OID=s.OID AND t.OVer=s.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN DSDBDaccess p ON p.OID=o.OID AND p.OVer=o.OVer
    LEFT OUTER JOIN adobjectFind u ON u.OID=t.adTarget AND
       u.className='DSIMSDDname' AND
       u.contextRelease=a.contextRelease AND u.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN DSIMSDDname v ON v.OID=u.OID AND v.OVer=u.OVer
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

CREATE VIEW DAQPSBGlossary AS 
  SELECT
    a.*,
    b.compatibility,
    b.hpPSBName,
    b.ioaSize,
    b.ioErrorOption,
    b.language,
    b.maximumQxCalls,
    b.onlineImageCopy,
    b.lockMaximum,
    b.ssaSize,
    b.writeToOperator,
    f.name as psbName,
    l.contents as psbDescription,
    l.label as psbDescType
  FROM
    OIDOVers a
    INNER JOIN DSPSB_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSPSB_version'
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

CREATE VIEW DAQDBDSegments AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    x.name as imsFieldName,
    ad.contents as fldDescription,
    ad.label as fldDescType,
    al.name as imsSegmentName,
    ar.contents as segDescription,
    ar.label as segDescType
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN ADLink_source g ON g.classAttr='DSDBD_version.segments' AND
      g.sourceOID=b.OID AND g.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind h ON h.OID=g.relOID AND h.OVer=g.relOVer AND
       h.className='DSContainsSegment' AND
       h.contextRelease=a.contextRelease AND h.contextName=a.contextName
    LEFT OUTER JOIN ADLink i ON i.OID=h.OID AND i.OVer=h.OVer
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    LEFT OUTER JOIN adobjectFind j ON j.OID=i.adTarget AND
       j.className='DSSegment' AND
       j.contextRelease=a.contextRelease AND j.contextName=a.contextName
    LEFT OUTER JOIN DSSegment k ON k.OID=j.OID AND k.OVer=j.OVer
    LEFT OUTER JOIN ADLink_source l ON l.classAttr='DSSegment.fields' AND
      l.sourceOID=k.OID AND l.sourceOVer=k.OVer
    LEFT OUTER JOIN adobjectFind m ON m.OID=l.relOID AND m.OVer=l.relOVer AND
       m.className='DSHasField' AND
       m.contextRelease=a.contextRelease AND m.contextName=a.contextName
    LEFT OUTER JOIN ADLink n ON n.OID=m.OID AND n.OVer=m.OVer
    LEFT OUTER JOIN adobjectFind ae ON ae.OID=k.segmName AND
       ae.className='DSHasIMSsegmName' AND
       ae.contextRelease=a.contextRelease AND ae.contextName=a.contextName
    LEFT OUTER JOIN ADLink af ON af.OID=ae.OID AND af.OVer=ae.OVer
    LEFT OUTER JOIN adobjectFind o ON o.OID=n.adTarget AND
       o.className='DSField' AND
       o.contextRelease=a.contextRelease AND o.contextName=a.contextName
    LEFT OUTER JOIN OIDOVers ag ON ag.OID=af.adTarget AND  ag.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass aj ON aj.OID=af.adTarget AND aj.OVer=af.OVer
    LEFT OUTER JOIN DSField p ON p.OID=o.OID AND p.OVer=o.OVer
    LEFT OUTER JOIN TCSourceObject ak ON ak.OID=aj.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind q ON q.OID=p.fldName AND
       q.className='DSHasIMSfldName' AND
       q.contextRelease=a.contextRelease AND q.contextName=a.contextName
    LEFT OUTER JOIN ADLink r ON r.OID=q.OID AND r.OVer=q.OVer
    LEFT OUTER JOIN FHCPath al ON al.OID=ak.osrelNuPathId
    LEFT OUTER JOIN ADObject am ON am.OID=af.OID AND am.OVer=af.OVer AND
     am.className='DSDataStructureAlias_version'
    LEFT OUTER JOIN OIDOVers s ON s.OID=r.adTarget AND  s.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass v ON v.OID=r.adTarget AND v.OVer=r.OVer
    LEFT OUTER JOIN ADLink_source an ON an.classAttr='ADAnnotatedObject.pAnnotationText' AND
      an.sourceOID=am.OID AND an.sourceOVer=am.OVer
    LEFT OUTER JOIN adobjectFind ao ON ao.OID=an.relOID AND ao.OVer=an.relOVer AND
       ao.className='ADLinkADAnnotObj2AnnotTxt' AND
       ao.contextRelease=a.contextRelease AND ao.contextName=a.contextName
    LEFT OUTER JOIN ADLink ap ON ap.OID=ao.OID AND ap.OVer=ao.OVer
    LEFT OUTER JOIN TCSourceObject w ON w.OID=v.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind aq ON aq.OID=ap.adTarget AND
       aq.className='ADAnnotationText' AND
       aq.contextRelease=a.contextRelease AND aq.contextName=a.contextName
    LEFT OUTER JOIN FHCPath x ON x.OID=w.osrelNuPathId
    LEFT OUTER JOIN ADObject y ON y.OID=r.OID AND y.OVer=r.OVer AND
     y.className='DSDataElementAlias_version'
    LEFT OUTER JOIN ADAnnotationText ar ON ar.OID=aq.OID AND ar.OVer=aq.OVer
    LEFT OUTER JOIN ADLink_source z ON z.classAttr='ADAnnotatedObject.pAnnotationText' AND
      z.sourceOID=y.OID AND z.sourceOVer=y.OVer
    LEFT OUTER JOIN adobjectFind aa ON aa.OID=z.relOID AND aa.OVer=z.relOVer AND
       aa.className='ADLinkADAnnotObj2AnnotTxt' AND
       aa.contextRelease=a.contextRelease AND aa.contextName=a.contextName
    LEFT OUTER JOIN ADLink ab ON ab.OID=aa.OID AND ab.OVer=aa.OVer
    LEFT OUTER JOIN adobjectFind ac ON ac.OID=ab.adTarget AND
       ac.className='ADAnnotationText' AND
       ac.contextRelease=a.contextRelease AND ac.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText ad ON ad.OID=ac.OID AND ad.OVer=ac.OVer;

CREATE VIEW DAQDBDSegmDEDB AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    y.name as imsFieldName,
    ae.contents as fldDescription,
    ae.label as fldDescType,
    am.name as imsSegmentName,
    at.contents as segDescription,
    at.label as segDescType
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN ADLink_source g ON g.classAttr='DSDBD_version.segments' AND
      g.sourceOID=b.OID AND g.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind h ON h.OID=g.relOID AND h.OVer=g.relOVer AND
       h.className='DSContainsSegment' AND
       h.contextRelease=a.contextRelease AND h.contextName=a.contextName
    LEFT OUTER JOIN ADLink i ON i.OID=h.OID AND i.OVer=h.OVer
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    LEFT OUTER JOIN adobjectFind j ON j.OID=i.adTarget AND
       j.className='DSSegmentDEDB' AND
       j.contextRelease=a.contextRelease AND j.contextName=a.contextName
    LEFT OUTER JOIN DSSegment l ON l.OID=j.OID AND l.OVer=j.OVer
    LEFT OUTER JOIN ADLink_source m ON m.classAttr='DSSegment.fields' AND
      m.sourceOID=l.OID AND m.sourceOVer=l.OVer
    LEFT OUTER JOIN adobjectFind n ON n.OID=m.relOID AND n.OVer=m.relOVer AND
       n.className='DSHasField' AND
       n.contextRelease=a.contextRelease AND n.contextName=a.contextName
    LEFT OUTER JOIN ADLink o ON o.OID=n.OID AND o.OVer=n.OVer
    LEFT OUTER JOIN adobjectFind af ON af.OID=l.segmName AND
       af.className='DSHasIMSsegmName' AND
       af.contextRelease=a.contextRelease AND af.contextName=a.contextName
    LEFT OUTER JOIN ADLink ag ON ag.OID=af.OID AND ag.OVer=af.OVer
    LEFT OUTER JOIN adobjectFind p ON p.OID=o.adTarget AND
       p.className='DSField' AND
       p.contextRelease=a.contextRelease AND p.contextName=a.contextName
    LEFT OUTER JOIN OIDOVers ah ON ah.OID=ag.adTarget AND  ah.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass ak ON ak.OID=ag.adTarget AND ak.OVer=ag.OVer
    LEFT OUTER JOIN DSField q ON q.OID=p.OID AND q.OVer=p.OVer
    LEFT OUTER JOIN TCSourceObject al ON al.OID=ak.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind r ON r.OID=q.fldName AND
       r.className='DSHasIMSfldName' AND
       r.contextRelease=a.contextRelease AND r.contextName=a.contextName
    LEFT OUTER JOIN ADLink s ON s.OID=r.OID AND s.OVer=r.OVer
    LEFT OUTER JOIN FHCPath am ON am.OID=al.osrelNuPathId
    LEFT OUTER JOIN ADObject an ON an.OID=ag.OID AND an.OVer=ag.OVer AND
     an.className='DSDataStructureAlias_version'
    LEFT OUTER JOIN OIDOVers t ON t.OID=s.adTarget AND  t.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass w ON w.OID=s.adTarget AND w.OVer=s.OVer
    LEFT OUTER JOIN ADLink_source ao ON ao.classAttr='ADAnnotatedObject.pAnnotationText' AND
      ao.sourceOID=an.OID AND ao.sourceOVer=an.OVer
    LEFT OUTER JOIN adobjectFind ap ON ap.OID=ao.relOID AND ap.OVer=ao.relOVer AND
       ap.className='ADLinkADAnnotObj2AnnotTxt' AND
       ap.contextRelease=a.contextRelease AND ap.contextName=a.contextName
    LEFT OUTER JOIN ADLink aq ON aq.OID=ap.OID AND aq.OVer=ap.OVer
    LEFT OUTER JOIN TCSourceObject x ON x.OID=w.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind ar ON ar.OID=aq.adTarget AND
       ar.className='ADAnnotationText' AND
       ar.contextRelease=a.contextRelease AND ar.contextName=a.contextName
    LEFT OUTER JOIN FHCPath y ON y.OID=x.osrelNuPathId
    LEFT OUTER JOIN ADObject z ON z.OID=s.OID AND z.OVer=s.OVer AND
     z.className='DSDataElementAlias_version'
    LEFT OUTER JOIN ADAnnotationText at ON at.OID=ar.OID AND at.OVer=ar.OVer
    LEFT OUTER JOIN ADLink_source aa ON aa.classAttr='ADAnnotatedObject.pAnnotationText' AND
      aa.sourceOID=z.OID AND aa.sourceOVer=z.OVer
    LEFT OUTER JOIN adobjectFind ab ON ab.OID=aa.relOID AND ab.OVer=aa.relOVer AND
       ab.className='ADLinkADAnnotObj2AnnotTxt' AND
       ab.contextRelease=a.contextRelease AND ab.contextName=a.contextName
    LEFT OUTER JOIN ADLink ac ON ac.OID=ab.OID AND ac.OVer=ab.OVer
    LEFT OUTER JOIN adobjectFind ad ON ad.OID=ac.adTarget AND
       ad.className='ADAnnotationText' AND
       ad.contextRelease=a.contextRelease AND ad.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText ae ON ae.OID=ad.OID AND ae.OVer=ad.OVer;

CREATE VIEW DAQDBDSegmComplex AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    y.name as imsFieldName,
    ae.contents as fldDescription,
    ae.label as fldDescType,
    am.name as imsSegmentName,
    at.contents as segDescription,
    at.label as segDescType
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN ADLink_source g ON g.classAttr='DSDBD_version.segments' AND
      g.sourceOID=b.OID AND g.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind h ON h.OID=g.relOID AND h.OVer=g.relOVer AND
       h.className='DSContainsSegment' AND
       h.contextRelease=a.contextRelease AND h.contextName=a.contextName
    LEFT OUTER JOIN ADLink i ON i.OID=h.OID AND i.OVer=h.OVer
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    LEFT OUTER JOIN adobjectFind j ON j.OID=i.adTarget AND
       j.className='DSSegmentComplex' AND
       j.contextRelease=a.contextRelease AND j.contextName=a.contextName
    LEFT OUTER JOIN DSSegment l ON l.OID=j.OID AND l.OVer=j.OVer
    LEFT OUTER JOIN ADLink_source m ON m.classAttr='DSSegment.fields' AND
      m.sourceOID=l.OID AND m.sourceOVer=l.OVer
    LEFT OUTER JOIN adobjectFind n ON n.OID=m.relOID AND n.OVer=m.relOVer AND
       n.className='DSHasField' AND
       n.contextRelease=a.contextRelease AND n.contextName=a.contextName
    LEFT OUTER JOIN ADLink o ON o.OID=n.OID AND o.OVer=n.OVer
    LEFT OUTER JOIN adobjectFind af ON af.OID=l.segmName AND
       af.className='DSHasIMSsegmName' AND
       af.contextRelease=a.contextRelease AND af.contextName=a.contextName
    LEFT OUTER JOIN ADLink ag ON ag.OID=af.OID AND ag.OVer=af.OVer
    LEFT OUTER JOIN adobjectFind p ON p.OID=o.adTarget AND
       p.className='DSField' AND
       p.contextRelease=a.contextRelease AND p.contextName=a.contextName
    LEFT OUTER JOIN OIDOVers ah ON ah.OID=ag.adTarget AND  ah.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass ak ON ak.OID=ag.adTarget AND ak.OVer=ag.OVer
    LEFT OUTER JOIN DSField q ON q.OID=p.OID AND q.OVer=p.OVer
    LEFT OUTER JOIN TCSourceObject al ON al.OID=ak.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind r ON r.OID=q.fldName AND
       r.className='DSHasIMSfldName' AND
       r.contextRelease=a.contextRelease AND r.contextName=a.contextName
    LEFT OUTER JOIN ADLink s ON s.OID=r.OID AND s.OVer=r.OVer
    LEFT OUTER JOIN FHCPath am ON am.OID=al.osrelNuPathId
    LEFT OUTER JOIN ADObject an ON an.OID=ag.OID AND an.OVer=ag.OVer AND
     an.className='DSDataStructureAlias_version'
    LEFT OUTER JOIN OIDOVers t ON t.OID=s.adTarget AND  t.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass w ON w.OID=s.adTarget AND w.OVer=s.OVer
    LEFT OUTER JOIN ADLink_source ao ON ao.classAttr='ADAnnotatedObject.pAnnotationText' AND
      ao.sourceOID=an.OID AND ao.sourceOVer=an.OVer
    LEFT OUTER JOIN adobjectFind ap ON ap.OID=ao.relOID AND ap.OVer=ao.relOVer AND
       ap.className='ADLinkADAnnotObj2AnnotTxt' AND
       ap.contextRelease=a.contextRelease AND ap.contextName=a.contextName
    LEFT OUTER JOIN ADLink aq ON aq.OID=ap.OID AND aq.OVer=ap.OVer
    LEFT OUTER JOIN TCSourceObject x ON x.OID=w.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind ar ON ar.OID=aq.adTarget AND
       ar.className='ADAnnotationText' AND
       ar.contextRelease=a.contextRelease AND ar.contextName=a.contextName
    LEFT OUTER JOIN FHCPath y ON y.OID=x.osrelNuPathId
    LEFT OUTER JOIN ADObject z ON z.OID=s.OID AND z.OVer=s.OVer AND
     z.className='DSDataElementAlias_version'
    LEFT OUTER JOIN ADAnnotationText at ON at.OID=ar.OID AND at.OVer=ar.OVer
    LEFT OUTER JOIN ADLink_source aa ON aa.classAttr='ADAnnotatedObject.pAnnotationText' AND
      aa.sourceOID=z.OID AND aa.sourceOVer=z.OVer
    LEFT OUTER JOIN adobjectFind ab ON ab.OID=aa.relOID AND ab.OVer=aa.relOVer AND
       ab.className='ADLinkADAnnotObj2AnnotTxt' AND
       ab.contextRelease=a.contextRelease AND ab.contextName=a.contextName
    LEFT OUTER JOIN ADLink ac ON ac.OID=ab.OID AND ac.OVer=ab.OVer
    LEFT OUTER JOIN adobjectFind ad ON ad.OID=ac.adTarget AND
       ad.className='ADAnnotationText' AND
       ad.contextRelease=a.contextRelease AND ad.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText ae ON ae.OID=ad.OID AND ae.OVer=ad.OVer;

CREATE VIEW DAQDBDSegmLogical AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    t.name as imsSegmentName,
    z.contents as segDescription,
    z.label as segDescType
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN ADLink_source g ON g.classAttr='DSDBD_version.segments' AND
      g.sourceOID=b.OID AND g.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind h ON h.OID=g.relOID AND h.OVer=g.relOVer AND
       h.className='DSContainsSegment' AND
       h.contextRelease=a.contextRelease AND h.contextName=a.contextName
    LEFT OUTER JOIN ADLink i ON i.OID=h.OID AND i.OVer=h.OVer
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    LEFT OUTER JOIN adobjectFind j ON j.OID=i.adTarget AND
       j.className='DSSegmentLogical' AND
       j.contextRelease=a.contextRelease AND j.contextName=a.contextName
    LEFT OUTER JOIN DSSegment l ON l.OID=j.OID AND l.OVer=j.OVer
    LEFT OUTER JOIN adobjectFind m ON m.OID=l.segmName AND
       m.className='DSHasIMSsegmName' AND
       m.contextRelease=a.contextRelease AND m.contextName=a.contextName
    LEFT OUTER JOIN ADLink n ON n.OID=m.OID AND n.OVer=m.OVer
    LEFT OUTER JOIN OIDOVers o ON o.OID=n.adTarget AND  o.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass r ON r.OID=n.adTarget AND r.OVer=n.OVer
    LEFT OUTER JOIN TCSourceObject s ON s.OID=r.osrelTCSourceObjct
    LEFT OUTER JOIN FHCPath t ON t.OID=s.osrelNuPathId
    LEFT OUTER JOIN ADObject u ON u.OID=n.OID AND u.OVer=n.OVer AND
     u.className='DSDataStructureAlias_version'
    LEFT OUTER JOIN ADLink_source v ON v.classAttr='ADAnnotatedObject.pAnnotationText' AND
      v.sourceOID=u.OID AND v.sourceOVer=u.OVer
    LEFT OUTER JOIN adobjectFind w ON w.OID=v.relOID AND w.OVer=v.relOVer AND
       w.className='ADLinkADAnnotObj2AnnotTxt' AND
       w.contextRelease=a.contextRelease AND w.contextName=a.contextName
    LEFT OUTER JOIN ADLink x ON x.OID=w.OID AND x.OVer=w.OVer
    LEFT OUTER JOIN adobjectFind y ON y.OID=x.adTarget AND
       y.className='ADAnnotationText' AND
       y.contextRelease=a.contextRelease AND y.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText z ON z.OID=y.OID AND z.OVer=y.OVer;

CREATE VIEW DAQDBDdedbAccess AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    l.contents as dbdDescription,
    l.label as dbdDescType,
    q.dliAccess,
    p.rmName,
    p.stage,
    p.extendedCall,
    t.dsDevice,
    t.dsModel,
    w.ddsName
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind m ON m.OID=b.dliAccess AND
       m.className='DSDefinedByAccess' AND
       m.contextRelease=a.contextRelease AND m.contextName=a.contextName
    LEFT OUTER JOIN ADLink n ON n.OID=m.OID AND n.OVer=m.OVer
    LEFT OUTER JOIN ADLink_source r ON r.classAttr='DSDBD_version.datasets' AND
      r.sourceOID=b.OID AND r.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind s ON s.OID=r.relOID AND s.OVer=r.relOVer AND
       s.className='DSDSColl' AND
       s.contextRelease=a.contextRelease AND s.contextName=a.contextName
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSDBD_version'
    LEFT OUTER JOIN adobjectFind o ON o.OID=n.adTarget AND
       o.className='DSDBDdedb' AND
       o.contextRelease=a.contextRelease AND o.contextName=a.contextName
    LEFT OUTER JOIN DSDSColl t ON t.OID=s.OID AND t.OVer=s.OVer
    LEFT OUTER JOIN ADLink u ON u.OID=t.OID AND u.OVer=t.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN DSDBDdedb p ON p.OID=o.OID AND p.OVer=o.OVer
    LEFT OUTER JOIN DSDBDaccess q ON q.OID=p.OID AND q.OVer=p.OVer
    LEFT OUTER JOIN adobjectFind v ON v.OID=u.adTarget AND
       v.className='DSIMSDDname' AND
       v.contextRelease=a.contextRelease AND v.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN DSIMSDDname w ON w.OID=v.OID AND w.OVer=v.OVer
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

CREATE VIEW DAQDBDmsdbAccess AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    l.contents as dbdDescription,
    l.label as dbdDescType,
    q.dliAccess,
    p.msdbField,
    p.msdbType
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind m ON m.OID=b.dliAccess AND
       m.className='DSDefinedByAccess' AND
       m.contextRelease=a.contextRelease AND m.contextName=a.contextName
    LEFT OUTER JOIN ADLink n ON n.OID=m.OID AND n.OVer=m.OVer
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSDBD_version'
    LEFT OUTER JOIN adobjectFind o ON o.OID=n.adTarget AND
       o.className='DSDBDmsdb' AND
       o.contextRelease=a.contextRelease AND o.contextName=a.contextName
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN DSDBDmsdb p ON p.OID=o.OID AND p.OVer=o.OVer
    LEFT OUTER JOIN DSDBDaccess q ON q.OID=p.OID AND q.OVer=p.OVer
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

CREATE VIEW DAQDBDhidamAccess AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    l.contents as dbdDescription,
    l.label as dbdDescType,
    q.dliAccess,
    q.osAccess,
    q.passwordFlag,
    t.dsDevice,
    t.dsModel,
    w.ddsName
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind m ON m.OID=b.dliAccess AND
       m.className='DSDefinedByAccess' AND
       m.contextRelease=a.contextRelease AND m.contextName=a.contextName
    LEFT OUTER JOIN ADLink n ON n.OID=m.OID AND n.OVer=m.OVer
    LEFT OUTER JOIN ADLink_source r ON r.classAttr='DSDBD_version.datasets' AND
      r.sourceOID=b.OID AND r.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind s ON s.OID=r.relOID AND s.OVer=r.relOVer AND
       s.className='DSDSColl' AND
       s.contextRelease=a.contextRelease AND s.contextName=a.contextName
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSDBD_version'
    LEFT OUTER JOIN adobjectFind o ON o.OID=n.adTarget AND
       o.className='DSDBDhidam' AND
       o.contextRelease=a.contextRelease AND o.contextName=a.contextName
    LEFT OUTER JOIN DSDSColl t ON t.OID=s.OID AND t.OVer=s.OVer
    LEFT OUTER JOIN ADLink u ON u.OID=t.OID AND u.OVer=t.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN DSDBDaccess q ON q.OID=o.OID AND q.OVer=o.OVer
    LEFT OUTER JOIN adobjectFind v ON v.OID=u.adTarget AND
       v.className='DSIMSDDname' AND
       v.contextRelease=a.contextRelease AND v.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN DSIMSDDname w ON w.OID=v.OID AND w.OVer=v.OVer
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

CREATE VIEW DAQDBDhdamAccess AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    l.contents as dbdDescription,
    l.label as dbdDescType,
    q.dliAccess,
    q.osAccess,
    q.passwordFlag,
    p.relativeBlockNumbr,
    p.rootAnchorPoints,
    p.rootMaxBytes,
    r.rmName,
    u.dsDevice,
    u.dsModel,
    x.ddsName
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind m ON m.OID=b.dliAccess AND
       m.className='DSDefinedByAccess' AND
       m.contextRelease=a.contextRelease AND m.contextName=a.contextName
    LEFT OUTER JOIN ADLink n ON n.OID=m.OID AND n.OVer=m.OVer
    LEFT OUTER JOIN ADLink_source s ON s.classAttr='DSDBD_version.datasets' AND
      s.sourceOID=b.OID AND s.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind t ON t.OID=s.relOID AND t.OVer=s.relOVer AND
       t.className='DSDSColl' AND
       t.contextRelease=a.contextRelease AND t.contextName=a.contextName
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSDBD_version'
    LEFT OUTER JOIN adobjectFind o ON o.OID=n.adTarget AND
       o.className='DSDBDhdam' AND
       o.contextRelease=a.contextRelease AND o.contextName=a.contextName
    LEFT OUTER JOIN DSDSColl u ON u.OID=t.OID AND u.OVer=t.OVer
    LEFT OUTER JOIN ADLink v ON v.OID=u.OID AND v.OVer=u.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN DSDBDhdam p ON p.OID=o.OID AND p.OVer=o.OVer
    LEFT OUTER JOIN DSDBDaccess q ON q.OID=p.OID AND q.OVer=p.OVer
    LEFT OUTER JOIN DSDBDdedb r ON r.OID=p.OID AND r.OVer=p.OVer
    LEFT OUTER JOIN adobjectFind w ON w.OID=v.adTarget AND
       w.className='DSIMSDDname' AND
       w.contextRelease=a.contextRelease AND w.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN DSIMSDDname x ON x.OID=w.OID AND x.OVer=w.OVer
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

CREATE VIEW DAQDBDindexAccess AS 
  SELECT
    a.*,
    f.name as rootDBDname,
    l.contents as dbdDescription,
    l.label as dbdDescType,
    q.dliAccess,
    q.passwordFlag,
    p.dosCompatibility,
    p.protect,
    t.dsDevice,
    t.dsModel,
    w.ddsName
  FROM
    OIDOVers a
    INNER JOIN DSDBD_version b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind m ON m.OID=b.dliAccess AND
       m.className='DSDefinedByAccess' AND
       m.contextRelease=a.contextRelease AND m.contextName=a.contextName
    LEFT OUTER JOIN ADLink n ON n.OID=m.OID AND n.OVer=m.OVer
    LEFT OUTER JOIN ADLink_source r ON r.classAttr='DSDBD_version.datasets' AND
      r.sourceOID=b.OID AND r.sourceOVer=b.OVer
    LEFT OUTER JOIN adobjectFind s ON s.OID=r.relOID AND s.OVer=r.relOVer AND
       s.className='DSDSColl' AND
       s.contextRelease=a.contextRelease AND s.contextName=a.contextName
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSDBD_version'
    LEFT OUTER JOIN adobjectFind o ON o.OID=n.adTarget AND
       o.className='DSDBDindex' AND
       o.contextRelease=a.contextRelease AND o.contextName=a.contextName
    LEFT OUTER JOIN DSDSColl t ON t.OID=s.OID AND t.OVer=s.OVer
    LEFT OUTER JOIN ADLink u ON u.OID=t.OID AND u.OVer=t.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN DSDBDindex p ON p.OID=o.OID AND p.OVer=o.OVer
    LEFT OUTER JOIN DSDBDaccess q ON q.OID=p.OID AND q.OVer=p.OVer
    LEFT OUTER JOIN adobjectFind v ON v.OID=u.adTarget AND
       v.className='DSIMSDDname' AND
       v.contextRelease=a.contextRelease AND v.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN DSIMSDDname w ON w.OID=v.OID AND w.OVer=v.OVer
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

CREATE VIEW DAQSegmentText AS 
  SELECT
    a.*,
    f.name as imsSegmentName,
    l.contents as segDescription,
    l.label as segDescType
  FROM
    OIDOVers a
    INNER JOIN DSDtStrctrAls_vrsn b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSDataStructureAlias_version'
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

CREATE VIEW DAQFieldText AS 
  SELECT
    a.*,
    f.name as imsFieldName,
    l.contents as fldDescription,
    l.label as fldDescType
  FROM
    OIDOVers a
    INNER JOIN DSDatElmntAls_vrsn b ON a.OID=b.OID AND a.OVer=b.OVer
    LEFT OUTER JOIN TCVersionClass d ON d.OID=b.OID AND d.OVer=b.OVer
    LEFT OUTER JOIN TCSourceObject e ON e.OID=d.osrelTCSourceObjct
    LEFT OUTER JOIN FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='DSDataElementAlias_version'
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='ADAnnotatedObject.pAnnotationText' AND
      h.sourceOID=g.OID AND h.sourceOVer=g.OVer
    LEFT OUTER JOIN adobjectFind i ON i.OID=h.relOID AND i.OVer=h.relOVer AND
       i.className='ADLinkADAnnotObj2AnnotTxt' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName
    LEFT OUTER JOIN ADLink j ON j.OID=i.OID AND j.OVer=i.OVer
    LEFT OUTER JOIN adobjectFind k ON k.OID=j.adTarget AND
       k.className='ADAnnotationText' AND
       k.contextRelease=a.contextRelease AND k.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer;

