SELECT 'PER:'||a.supervisor_id
FROM (SELECT t.person_id
,t.supervisor_id
FROM per_assignments_f t
WHERE SYSDATE BETWEEN nvl(t.effective_start_date, SYSDATE) AND
nvl(t.effective_end_date, SYSDATE)
AND t.primary_flag = 'Y'
AND t.supervisor_id IS NOT NULL) a
WHERE (SELECT aw.signing_limit
FROM ap_web_signing_limits_all aw
,ap_expense_report_headers_all ae
WHERE aw.cost_center = ae.flex_concatenated
AND ae.report_header_id = :transactionId
AND aw.employee_id = a.supervisor_id
AND aw.org_id = ae.org_id) IS NOT NULL
CONNECT BY a.person_id = PRIOR a.supervisor_id
START WITH a.person_id =
(SELECT ae.employee_id
FROM ap_expense_report_headers_all ae
WHERE ae.report_header_id = :transactionId )
FROM (SELECT t.person_id
,t.supervisor_id
FROM per_assignments_f t
WHERE SYSDATE BETWEEN nvl(t.effective_start_date, SYSDATE) AND
nvl(t.effective_end_date, SYSDATE)
AND t.primary_flag = 'Y'
AND t.supervisor_id IS NOT NULL) a
WHERE (SELECT aw.signing_limit
FROM ap_web_signing_limits_all aw
,ap_expense_report_headers_all ae
WHERE aw.cost_center = ae.flex_concatenated
AND ae.report_header_id = :transactionId
AND aw.employee_id = a.supervisor_id
AND aw.org_id = ae.org_id) IS NOT NULL
CONNECT BY a.person_id = PRIOR a.supervisor_id
START WITH a.person_id =
(SELECT ae.employee_id
FROM ap_expense_report_headers_all ae
WHERE ae.report_header_id = :transactionId )
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10359218/viewspace-1063939/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10359218/viewspace-1063939/