SELECT D.OPRID , A.PTAI_LIST_ID , B.LANGUAGE_CD , B.PTAI_LABEL FROM PS_PTAI_LIST A , PS_PTAI_LIST_LNG B , PSOPRDEFN D WHERE B.PTAI_LIST_ID = A.PTAI_LIST_ID AND A.PTAI_ACTIVE_FLG = 'Y' AND A.PTAI_IS_TMPL='Y' AND A.PTAI_LIST_ID<>'PTAI_AGTMP' AND A.PTAI_GPDS_ID='PTAI_ACTIVITYGUIDE' AND (EXISTS ( SELECT 'X' FROM PS_PTAI_LIST_PRIV F WHERE F.PTAI_LIST_ID = A.PTAI_LIST_ID AND EXISTS ( SELECT 'X' FROM PSROLEUSER X WHERE X.ROLEUSER = D.OPRID AND ((F.PTAI_MBR_TYPE = 'USER' AND F.PTAI_MBR_NAME = X.ROLEUSER) OR (F.PTAI_MBR_TYPE = 'ROLE' AND F.PTAI_MBR_NAME = X.ROLENAME)))))
|