104: --
105: Cursor c_orgs_in_hierarchy
106: (p_version_id IN per_org_structure_versions_v.organization_structure_id%TYPE) IS
107: select posev.organization_id_parent org_id
108: from per_org_structure_elements_v posev
109: where posev.org_Structure_version_id = p_version_id
110: UNION
111: select posev.organization_id_child org_id
112: from per_org_structure_elements_v posev
108: from per_org_structure_elements_v posev
109: where posev.org_Structure_version_id = p_version_id
110: UNION
111: select posev.organization_id_child org_id
112: from per_org_structure_elements_v posev
113: where posev.org_Structure_version_id = p_version_id;
114: --
115: v_org_in_hierarchy BOOLEAN := FALSE;
116: v_users_starting_node VARCHAR2(240) := NULL;
172: select 'Y'
173: into l_temp
174: from sys.dual
175: where exists (select null
176: from per_org_structure_elements ose
177: where ose.org_structure_version_id =
178: p_org_structure_version_id
179: and (ose.organization_id_child = p_organization_id
180: or ose.organization_id_parent = p_organization_id));
194: l_parent_id NUMBER :=0;
195: begin
196: select ose.organization_id_parent
197: into l_parent_id
198: from per_org_structure_elements ose
199: where ose.org_structure_version_id = p_org_structure_version_id
200: and ose.organization_id_child = p_organization_id;
201: --
202: --
219: p_exists_in_hierarchy:= exists_in_hierarchy(p_org_structure_version_id
220: ,p_organization_id);
221: if p_exists_in_hierarchy = 'Y' then
222: p_number_of_subordinates :=
223: per_org_structure_elements_pkg.get_subordinates(p_view_all_orgs
224: ,p_organization_id
225: ,p_org_structure_version_id
226: ,p_security_profile_id);
227: else