2103:
2104: begin
2105: select count(*) into l_num
2106: from wip_discrete_jobs wdj,
2107: oke_k_deliverables_b okd,
2108: (select k_header_id,
2109: oke_k_security_pkg.get_k_access(k_header_id) acc
2110: from oke_k_deliverables_b) okh
2111: where wdj.wip_entity_id = p_jobID
2106: from wip_discrete_jobs wdj,
2107: oke_k_deliverables_b okd,
2108: (select k_header_id,
2109: oke_k_security_pkg.get_k_access(k_header_id) acc
2110: from oke_k_deliverables_b) okh
2111: where wdj.wip_entity_id = p_jobID
2112: and okd.project_id = wdj.project_id
2113: and nvl(okd.task_id, -1) = nvl(wdj.task_id, -1)
2114: and okh.k_header_id = okd.k_header_id