SELECT A.ALIAS_NAME , DD.MENUNAME , DD.BARNAME , DD.ITEMLABEL , C.ITEMLABEL , A.PA_KEYVALUE , BB.LANGUAGE_CD , BB.LBLTEXT FROM PS_PA_ALIAS_XREF A , PSPNLFIELD B , PSPNLFIELDLANG BB , PSPNLGROUPLANG C , PSMENUITEM D , PSMENUITEMLANG DD WHERE A.PA_USEREC = B.RECNAME AND A.PA_USEFIELD = B.FIELDNAME AND C.PNLNAME= B.PNLNAME AND C.PNLGRPNAME = D.PNLGRPNAME AND DD.MENUNAME = D.MENUNAME AND DD.BARNAME = D.BARNAME AND DD.ITEMNAME = D.ITEMNAME AND BB.PNLNAME = B.PNLNAME AND BB.PNLFLDID = B.PNLFLDID AND ((A.PA_USEREC <> 'PA_CUSTOM2') OR (A.PA_USEREC = 'PA_CUSTOM2' AND (C.PNLGRPNAME = 'PLAN_ELIGIBILITY' AND 'P' = ( SELECT CUSTOM_TYPE FROM PS_PA_CUSTOM WHERE CUSTOM_STMT_NAME = A.PA_KEYVALUE)) OR (C.PNLGRPNAME = 'CUSTOM_STATMENT' AND 'C' = ( SELECT CUSTOM_TYPE FROM PS_PA_CUSTOM WHERE CUSTOM_STMT_NAME = A.PA_KEYVALUE)) OR (C.PNLGRPNAME = 'GROUP_DEFINITION' AND 'G' = ( SELECT CUSTOM_TYPE FROM PS_PA_CUSTOM WHERE CUSTOM_STMT_NAME = A.PA_KEYVALUE)) OR (C.PNLGRPNAME = 'BENEFIT_FORMULA' AND 'B' = ( SELECT CUSTOM_TYPE FROM PS_PA_CUSTOM WHERE CUSTOM_STMT_NAME = A.PA_KEYVALUE)) OR (C.PNLGRPNAME = 'STATUS_CODE_DEFINT' AND 'S' = ( SELECT CUSTOM_TYPE FROM PS_PA_CUSTOM WHERE CUSTOM_STMT_NAME = A.PA_KEYVALUE)) OR (C.PNLGRPNAME = 'SPOUSE_ELIGIBILITY' AND 'E' = ( SELECT CUSTOM_TYPE FROM PS_PA_CUSTOM WHERE CUSTOM_STMT_NAME = A.PA_KEYVALUE))))
|