79:
80: cursor c_business_place_count
81: is
82: select count(distinct hoi.org_information2||ihoi.org_information9) bp_count
83: from hr_organization_information hoi
84: ,hr_organization_units hou
85: ,hr_organization_units phou
86: ,hr_organization_information phoi
87: ,hr_organization_information ihoi
82: select count(distinct hoi.org_information2||ihoi.org_information9) bp_count
83: from hr_organization_information hoi
84: ,hr_organization_units hou
85: ,hr_organization_units phou
86: ,hr_organization_information phoi
87: ,hr_organization_information ihoi
88: where hou.organization_id = hoi.organization_id
89: and hoi.org_information_context = 'KR_BUSINESS_PLACE_REGISTRATION'
90: and hoi.org_information10 = phoi.org_information10
83: from hr_organization_information hoi
84: ,hr_organization_units hou
85: ,hr_organization_units phou
86: ,hr_organization_information phoi
87: ,hr_organization_information ihoi
88: where hou.organization_id = hoi.organization_id
89: and hoi.org_information_context = 'KR_BUSINESS_PLACE_REGISTRATION'
90: and hoi.org_information10 = phoi.org_information10
91: and phou.organization_id = primary_business_place_id
95: or ( (hoi.organization_id in (select posev.ORGANIZATION_ID_child
96: from PER_ORG_STRUCTURE_ELEMENTS posev
97: where posev.org_structure_version_id=(pay_magtape_generic.get_parameter_value('ORG_STRUC_VERSION_ID'))
98: and exists ( select null
99: from hr_organization_information
100: where organization_id = posev.ORGANIZATION_ID_child
101: and org_information_context = 'CLASS'
102: and org_information1 = 'KR_BUSINESS_PLACE'
103: )