SELECT DISTINCT OPR.OPRID , TMPL.AGC_TEMPLATE_ID , LSTL.LANGUAGE_CD , LSTL.PTAI_LABEL FROM PS_AGC_TMPL_TBL TMPL , PSOPRDEFN OPR , PS_PTAI_LIST LST , PS_PTAI_LIST_LNG LSTL WHERE TMPL.AGC_TEMPLATE_ID = %Substring(LST.PTAI_PARENT_TMPL,1,7) AND LST.PTAI_LIST_ID = LSTL.PTAI_LIST_ID AND (EXISTS ( SELECT 'X' FROM PS_PTAI_LIST_PRIV PRIV WHERE PRIV.PTAI_LIST_ID = LST.PTAI_LIST_ID AND PRIV.PTAI_PRIVSET_ID ='PTAI_CONTRIBUTOR' AND EXISTS ( SELECT 'X' FROM PSROLEUSER ROL WHERE ROL.ROLEUSER = OPR.OPRID AND ((PRIV.PTAI_MBR_TYPE = 'USER' AND PRIV.PTAI_MBR_NAME = ROL.ROLEUSER) OR (PRIV.PTAI_MBR_TYPE = 'ROLE' AND PRIV.PTAI_MBR_NAME = ROL.ROLENAME)))))
|