224: AND ptp.end_date = l_effective_date
225: AND ppf.payroll_id = ptp.payroll_id
226: AND l_effective_date BETWEEN ppf.effective_start_date and ppf.effective_end_date
227: AND pai_emp.action_information2 in (select to_char(pose.organization_id_child)
228: from per_org_structure_elements pose
229: connect by pose.organization_id_parent =
230: prior pose.organization_id_child
231: and pose.org_structure_version_id =
232: to_char (l_org_structure_version_id)
256: AND ptp.end_date = l_effective_date
257: AND ppf.payroll_id = ptp.payroll_id
258: AND l_effective_date BETWEEN ppf.effective_start_date and ppf.effective_end_date
259: AND pai_emp.action_information2 in (select to_char(pose.organization_id_child)
260: from per_org_structure_elements pose
261: connect by pose.organization_id_parent =
262: prior pose.organization_id_child
263: and pose.org_structure_version_id =
264: to_char (l_org_structure_version_id)
363: AND ptp.end_date = l_effective_date
364: AND ppf.payroll_id = ptp.payroll_id
365: AND l_effective_date BETWEEN ppf.effective_start_date and ppf.effective_end_date
366: AND pai_emp.action_information2 in (select to_char(pose.organization_id_child)
367: from per_org_structure_elements pose
368: connect by pose.organization_id_parent =
369: prior pose.organization_id_child
370: and pose.org_structure_version_id =
371: to_char (l_org_structure_version_id)
394: AND ptp.end_date = l_effective_date
395: AND ppf.payroll_id = ptp.payroll_id
396: AND l_effective_date BETWEEN ppf.effective_start_date and ppf.effective_end_date
397: AND pai_emp.action_information2 in (select to_char(pose.organization_id_child)
398: from per_org_structure_elements pose
399: connect by pose.organization_id_parent =
400: prior pose.organization_id_child
401: and pose.org_structure_version_id =
402: to_char (l_org_structure_version_id)
430: AND pai_emp.action_information2 = l_organization_id;
431: /* Cursor to tune the condition one sql performance */
432: Cursor csr_cond_1_tune (l_org_structure_version_id number,l_organization_id number, l_parent_id number) is
433: select to_char(pose.organization_id_child)
434: from per_org_structure_elements pose
435: connect by pose.organization_id_parent =
436: prior pose.organization_id_child
437: and pose.org_structure_version_id = to_char (l_org_structure_version_id)
438: start with pose.organization_id_parent = to_char(nvl(l_organization_id,l_parent_id))
700: AND ptp.time_period_id = pai_emp.action_information16
701: AND pai_emp.action_context_type = 'AAP'
702: AND pai_emp.action_information_category = 'EMPLOYEE DETAILS'
703: AND pai_emp.action_information2 in (select to_char(pose.organization_id_child)
704: from per_org_structure_elements pose
705: connect by pose.organization_id_parent =
706: prior pose.organization_id_child
707: and pose.org_structure_version_id =
708: to_char (l_org_structure_version_id)
815: AND ptp.time_period_id = pai_emp.action_information16
816: AND pai_emp.action_context_type = 'AAP'
817: AND pai_emp.action_information_category = 'EMPLOYEE DETAILS'
818: AND pai_emp.action_information2 in (select to_char(pose.organization_id_child)
819: from per_org_structure_elements pose
820: connect by pose.organization_id_parent =
821: prior pose.organization_id_child
822: and pose.org_structure_version_id =
823: to_char (l_org_structure_version_id)
956: if p_organization_id is null then
957: begin
958: select distinct pose.organization_id_parent
959: into l_parent_id
960: from per_org_structure_elements pose
961: where pose.org_structure_version_id = p_org_structure_version_id
962: and pose.organization_id_parent not in (select pose1.organization_id_child
963: from per_org_structure_elements pose1
964: where pose1.org_structure_version_id = p_org_structure_version_id);
959: into l_parent_id
960: from per_org_structure_elements pose
961: where pose.org_structure_version_id = p_org_structure_version_id
962: and pose.organization_id_parent not in (select pose1.organization_id_child
963: from per_org_structure_elements pose1
964: where pose1.org_structure_version_id = p_org_structure_version_id);
965: exception
966: when others then
967: l_err := 1;