925:
926: /* Cursor to retrieve top most organization in the hierarchy */
927: CURSOR csr_top_org(p_org_structure_version_id NUMBER) IS
928: SELECT DISTINCT pose.organization_id_parent
929: FROM per_org_structure_elements pose
930: WHERE pose.org_structure_version_id = p_org_structure_version_id
931: AND pose.organization_id_parent NOT IN (SELECT pose1.organization_id_child
932: FROM per_org_structure_elements pose1
933: WHERE pose1.org_structure_version_id = p_org_structure_version_id);
928: SELECT DISTINCT pose.organization_id_parent
929: FROM per_org_structure_elements pose
930: WHERE pose.org_structure_version_id = p_org_structure_version_id
931: AND pose.organization_id_parent NOT IN (SELECT pose1.organization_id_child
932: FROM per_org_structure_elements pose1
933: WHERE pose1.org_structure_version_id = p_org_structure_version_id);
934:
935: /* Cursor to retrieve Business Group Id */
936: CURSOR csr_bus_grp_id(p_organization_id NUMBER) IS
1006: l_person_id NUMBER;
1007: l_bg_id NUMBER;
1008: l_employer_name hr_organization_units.name%TYPE;
1009: l_org_struct_ver_id hr_organization_information.org_information1%TYPE;
1010: l_top_org_id per_org_structure_elements.organization_id_parent%TYPE;
1011: l_cost_center pay_cost_allocations_v.concatenated_segments%TYPE;
1012: l_defined_balance_id NUMBER;
1013: l_balance_value NUMBER;
1014: l_defined_balance_id_ded NUMBER;