SELECT SL.ROWID ROW_ID
, HR.FULL_NAME EMPLOYEE_NAME, SL.EMPLOYEE_ID
, AL.DISPLAYED_FIELD DISPLAYED_DOCUMENT_TYPE
, SL.DOCUMENT_TYPE
, SL.COST_CENTER
, SL.SIGNING_LIMIT
, SL.LAST_UPDATE_DATE
, SL.LAST_UPDATED_BY
, SL.LAST_UPDATE_LOGIN
, SL.CREATION_DATE
, SL.CREATED_BY
, SL.ORG_ID
FROM PER_EMPLOYEES_CURRENT_X HR
, AP_LOOKUP_CODES AL
, AP_WEB_SIGNING_LIMITS SL
WHERE SL.EMPLOYEE_ID = HR.EMPLOYEE_ID
AND SL.DOCUMENT_TYPE = AL.LOOKUP_CODE
AND AL.LOOKUP_TYPE = 'DOCUMENT TYPE'
AND NOT AP_WEB_DB_HR_INT_PKG.ISPERSONCWK(HR.EMPLOYEE_ID)='Y' UNION ALL SELECT SL.ROWID ROW_ID
, HR.FULL_NAME EMPLOYEE_NAME
, SL.EMPLOYEE_ID
, AL.DISPLAYED_FIELD DISPLAYED_DOCUMENT_TYPE
, SL.DOCUMENT_TYPE
, SL.COST_CENTER
, SL.SIGNING_LIMIT
, SL.LAST_UPDATE_DATE
, SL.LAST_UPDATED_BY
, SL.LAST_UPDATE_LOGIN
, SL.CREATION_DATE
, SL.CREATED_BY
, SL.ORG_ID
FROM PER_CONT_WORKERS_CURRENT_X HR
, AP_LOOKUP_CODES AL
, AP_WEB_SIGNING_LIMITS SL
WHERE SL.EMPLOYEE_ID = HR.PERSON_ID
AND SL.DOCUMENT_TYPE = AL.LOOKUP_CODE
AND AL.LOOKUP_TYPE = 'DOCUMENT TYPE'