CREATE VIEW VGEXTENDEDOBJECT AS 
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGObject_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;

CREATE VIEW VGAPPBUILDBase AS 
  SELECT
    a.*,
    f.name as adName,
    g.formatLvl,
    b.memberData
  FROM
    OIDOVers a
    INNER JOIN VGApplication_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 VGObject_version g ON g.OID=b.OID AND g.OVer=b.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='VGObject_version.pVGReferences' 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='VGLinkVGObject2VGObject' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName;

CREATE VIEW VGAPPDEFINITIONBas AS   -- VGAPPDEFINITIONBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGApplication_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;

CREATE VIEW VGAPPASSOCIATESBas AS   -- VGAPPASSOCIATESBase
  SELECT
    a.*,
    f.name as adName,
    g.formatLvl,
    b.memberData
  FROM
    OIDOVers a
    INNER JOIN VGApplication_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 VGObject_version g ON g.OID=b.OID AND g.OVer=b.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='VGObject_version.pVGReferences' 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='VGLinkVGObject2VGObject' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName;

CREATE VIEW VGAPPPRCASSOCBase AS 
  SELECT
    a.*,
    f.name as adName,
    g.formatLvl,
    b.memberData
  FROM
    OIDOVers a
    INNER JOIN VGProcess_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 VGObject_version g ON g.OID=b.OID AND g.OVer=b.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='VGObject_version.pVGReferences' 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='VGLinkVGObject2VGObject' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName;

CREATE VIEW VGAPPSTGASSOCBase AS 
  SELECT
    a.*,
    f.name as adName,
    g.formatLvl,
    b.memberData
  FROM
    OIDOVers a
    INNER JOIN VGStmtGroup_versin 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 VGObject_version g ON g.OID=b.OID AND g.OVer=b.OVer
    LEFT OUTER JOIN ADLink_source h ON h.classAttr='VGObject_version.pVGReferences' 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='VGLinkVGObject2VGObject' AND
       i.contextRelease=a.contextRelease AND i.contextName=a.contextName;

CREATE VIEW VGRCDASSOCIATESBas AS   -- VGRCDASSOCIATESBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGRecord_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;

CREATE VIEW VGGUIASSOCIATESBas AS   -- VGGUIASSOCIATESBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGGUI_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;

CREATE VIEW VGGUIPRCASSOCBase AS 
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGProcess_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;

CREATE VIEW VGGUISTGASSOCBase AS 
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGStmtGroup_versin 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;

CREATE VIEW VGMAPASSOCIATESBas AS   -- VGMAPASSOCIATESBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGMap_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;

CREATE VIEW VGPSBASSOCIATESBas AS   -- VGPSBASSOCIATESBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGPSB_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;

CREATE VIEW VGGUIBUILDBase AS 
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGGUI_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;

CREATE VIEW VGGUIDEFINITIONBas AS   -- VGGUIDEFINITIONBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGGUI_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;

CREATE VIEW VGMAPDEFINITIONBas AS   -- VGMAPDEFINITIONBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGMap_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;

CREATE VIEW VGPRCDEFINITIONBas AS   -- VGPRCDEFINITIONBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGProcess_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;

CREATE VIEW VGRCDDEFINITIONBas AS   -- VGRCDDEFINITIONBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGRecord_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;

CREATE VIEW VGSTGDEFINITIONBas AS   -- VGSTGDEFINITIONBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGStmtGroup_versin 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;

CREATE VIEW VGTBLDEFINITIONBas AS   -- VGTBLDEFINITIONBase
  SELECT
    a.*,
    f.name as adName
  FROM
    OIDOVers a
    INNER JOIN VGTable_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;

CREATE VIEW VISUALGENDATAITEM AS 
  SELECT
    a.*,
    f.name as adName,
    l.contents,
    l.label,
    m.formatLvl,
    u.name as DEAliasadName,
    ad.name as DEadName,
    aj.contents as DEcontents,
    aj.label as DElabel,
    an.asBitData,
    an.isSigned,
    an.isLOB,
    an.precision,
    an.scale,
    an.strLength,
    ar.genInvalidMsg,
    ar.genMinInputMsg,
    ar.genReqMsg,
    ar.genEditMsg,
    ar.genMinInput,
    ar.genFill,
    ar.genJustify,
    ar.genRoutine,
    ar.genDateEdit,
    ar.genInputReq,
    ar.genHexEdit,
    ar.genFold,
    ar.genSoSiSpace,
    ar.numRecFieldLen,
    ar.numRangeMsg,
    ar.numSign,
    ar.numMin,
    ar.numMax,
    ar.numCurrSym,
    ar.numNumSep,
    ar.numZeroEdit,
    an.strVaryingFlag,
    an.vgSignFormat,
    an.vgEvenPackSQL,
    an.typeCode
  FROM
    OIDOVers a
    INNER JOIN VGDataItem_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 adobjectFind n ON n.OID=b.pDEAliasAsVGName AND
       n.className='VGLinkVGDatItm2DEAlias' 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 FHCPath f ON f.OID=e.osrelNuPathId
    INNER JOIN ADObject g ON g.OID=b.OID AND g.OVer=b.OVer AND
     g.className='VGDataItem_version'
    LEFT OUTER JOIN OIDOVers p ON p.OID=o.adTarget AND  p.contextOID=a.contextOID
    LEFT OUTER JOIN TCVersionClass s ON s.OID=o.adTarget AND s.OVer=o.OVer
    LEFT OUTER JOIN OIDOVers y ON y.OID=x.adTarget AND  y.contextOID=a.contextOID
    LEFT OUTER JOIN DSDataElement_vrsn z ON z.OID=x.adTarget AND z.OVer=y.OVer
    LEFT OUTER JOIN TCVersionClass ab ON ab.OID=z.OID AND ab.OVer=z.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 TCSourceObject t ON t.OID=s.osrelTCSourceObjct
    LEFT OUTER JOIN TCSourceObject ac ON ac.OID=ab.osrelTCSourceObjct
    LEFT OUTER JOIN adobjectFind ak ON ak.OID=z.pSimpleTypeDef AND
       ak.className='DSLinkDataElmn2SmplType' AND
       ak.contextRelease=a.contextRelease AND ak.contextName=a.contextName
    LEFT OUTER JOIN ADLink al ON al.OID=ak.OID AND al.OVer=ak.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 ADObject ae ON ae.OID=z.OID AND ae.OVer=z.OVer AND
     ae.className='DSDataElement_version'
    LEFT OUTER JOIN adobjectFind am ON am.OID=al.adTarget AND
       am.className='DSSimpleTypeDef' AND
       am.contextRelease=a.contextRelease AND am.contextName=a.contextName
    LEFT OUTER JOIN ADAnnotationText l ON l.OID=k.OID AND l.OVer=k.OVer
    INNER JOIN VGObject_version m ON m.OID=b.OID AND m.OVer=b.OVer
    LEFT OUTER JOIN ADLink_source af ON af.classAttr='ADAnnotatedObject.pAnnotationText' AND
      af.sourceOID=ae.OID AND af.sourceOVer=ae.OVer
    LEFT OUTER JOIN adobjectFind ag ON ag.OID=af.relOID AND ag.OVer=af.relOVer AND
       ag.className='ADLinkADAnnotObj2AnnotTxt' AND
       ag.contextRelease=a.contextRelease AND ag.contextName=a.contextName
    LEFT OUTER JOIN ADLink ah ON ah.OID=ag.OID AND ah.OVer=ag.OVer
    LEFT OUTER JOIN DSSimpleTypeDef an ON an.OID=am.OID AND an.OVer=am.OVer
    LEFT OUTER JOIN adobjectFind ai ON ai.OID=ah.adTarget AND
       ai.className='ADAnnotationText' AND
       ai.contextRelease=a.contextRelease AND ai.contextName=a.contextName
    LEFT OUTER JOIN adobjectFind ao ON ao.OID=an.pVGDataDef AND
       ao.className='DSLinkSmplType2VGDatDef' 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 ADAnnotationText aj ON aj.OID=ai.OID AND aj.OVer=ai.OVer
    LEFT OUTER JOIN adobjectFind aq ON aq.OID=ap.adTarget AND
       aq.className='VGDataDef' AND
       aq.contextRelease=a.contextRelease AND aq.contextName=a.contextName
    LEFT OUTER JOIN VGDataDef ar ON ar.OID=aq.OID AND ar.OVer=aq.OVer;

