924: l_hrl_to_region1
925: from hr_locations_all hrl,
926: hr_locations_all_tl hlt,
927: fnd_territories_vl ftv,
928: fnd_lookup_values_vl flv1,
929: fnd_lookup_values_vl flv2,
930: fnd_lookup_values_vl flv3,
931: fnd_lookup_values_vl flv4
932: where hrl.region_1 = flv1.lookup_code (+)
925: from hr_locations_all hrl,
926: hr_locations_all_tl hlt,
927: fnd_territories_vl ftv,
928: fnd_lookup_values_vl flv1,
929: fnd_lookup_values_vl flv2,
930: fnd_lookup_values_vl flv3,
931: fnd_lookup_values_vl flv4
932: where hrl.region_1 = flv1.lookup_code (+)
933: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
926: hr_locations_all_tl hlt,
927: fnd_territories_vl ftv,
928: fnd_lookup_values_vl flv1,
929: fnd_lookup_values_vl flv2,
930: fnd_lookup_values_vl flv3,
931: fnd_lookup_values_vl flv4
932: where hrl.region_1 = flv1.lookup_code (+)
933: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
934: and hrl.location_id = hlt.location_id and hlt.language = USERENV('LANG')
927: fnd_territories_vl ftv,
928: fnd_lookup_values_vl flv1,
929: fnd_lookup_values_vl flv2,
930: fnd_lookup_values_vl flv3,
931: fnd_lookup_values_vl flv4
932: where hrl.region_1 = flv1.lookup_code (+)
933: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
934: and hrl.location_id = hlt.location_id and hlt.language = USERENV('LANG')
935: and hrl.region_2 = flv2.lookup_code (+)
942: AND hrl.country || '_PROVINCE' = flv4.lookup_type (+);
943:
944: /* Bug 2646120. The country code is not a mandatory one in hr_locations. So the country code
945: may be null. Changed the join with ftv to outer join. */
946: /* Bug 2791859 fnd_lookup_values_vl should be used instead of fnd_lookup_values */
947:
948: exception
949: when no_data_found then
950:
3012: l_ship_to_region2
3013: FROM hr_locations_all hrl,
3014: hr_locations_all_tl hlt,
3015: fnd_territories_vl ftv,
3016: fnd_lookup_values_vl flv1,
3017: fnd_lookup_values_vl flv2,
3018: fnd_lookup_values_vl flv3,
3019: fnd_lookup_values_vl flv4
3020: where hrl.region_1 = flv1.lookup_code (+)
3013: FROM hr_locations_all hrl,
3014: hr_locations_all_tl hlt,
3015: fnd_territories_vl ftv,
3016: fnd_lookup_values_vl flv1,
3017: fnd_lookup_values_vl flv2,
3018: fnd_lookup_values_vl flv3,
3019: fnd_lookup_values_vl flv4
3020: where hrl.region_1 = flv1.lookup_code (+)
3021: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3014: hr_locations_all_tl hlt,
3015: fnd_territories_vl ftv,
3016: fnd_lookup_values_vl flv1,
3017: fnd_lookup_values_vl flv2,
3018: fnd_lookup_values_vl flv3,
3019: fnd_lookup_values_vl flv4
3020: where hrl.region_1 = flv1.lookup_code (+)
3021: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3022: and hrl.location_id = hlt.location_id
3015: fnd_territories_vl ftv,
3016: fnd_lookup_values_vl flv1,
3017: fnd_lookup_values_vl flv2,
3018: fnd_lookup_values_vl flv3,
3019: fnd_lookup_values_vl flv4
3020: where hrl.region_1 = flv1.lookup_code (+)
3021: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3022: and hrl.location_id = hlt.location_id
3023: and hlt.language = USERENV('LANG')
3296: l_ship_to_region2
3297: FROM hr_locations_all hrl,
3298: hr_locations_all_tl hlt,
3299: fnd_territories_vl ftv,
3300: fnd_lookup_values_vl flv1,
3301: fnd_lookup_values_vl flv2,
3302: fnd_lookup_values_vl flv3,
3303: fnd_lookup_values_vl flv4
3304: where hrl.region_1 = flv1.lookup_code (+)
3297: FROM hr_locations_all hrl,
3298: hr_locations_all_tl hlt,
3299: fnd_territories_vl ftv,
3300: fnd_lookup_values_vl flv1,
3301: fnd_lookup_values_vl flv2,
3302: fnd_lookup_values_vl flv3,
3303: fnd_lookup_values_vl flv4
3304: where hrl.region_1 = flv1.lookup_code (+)
3305: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3298: hr_locations_all_tl hlt,
3299: fnd_territories_vl ftv,
3300: fnd_lookup_values_vl flv1,
3301: fnd_lookup_values_vl flv2,
3302: fnd_lookup_values_vl flv3,
3303: fnd_lookup_values_vl flv4
3304: where hrl.region_1 = flv1.lookup_code (+)
3305: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3306: and hrl.location_id = hlt.location_id
3299: fnd_territories_vl ftv,
3300: fnd_lookup_values_vl flv1,
3301: fnd_lookup_values_vl flv2,
3302: fnd_lookup_values_vl flv3,
3303: fnd_lookup_values_vl flv4
3304: where hrl.region_1 = flv1.lookup_code (+)
3305: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3306: and hrl.location_id = hlt.location_id
3307: and hlt.language = USERENV('LANG')
3633: into
3634: l_operating_unit_desc, l_operating_unit_add1,
3635: l_operating_unit_add2, l_operating_unit_add3, l_operating_unit_city,
3636: l_operating_unit_state,l_operating_unit_postal_code, l_operating_unit_country
3637: from hr_organization_units_v houv, fnd_territories_vl ftv, fnd_lookup_values_vl flv1, fnd_lookup_values_vl flv2,
3638: fnd_lookup_values_vl flv3
3639: where
3640: houv.region_1 = flv1.lookup_code (+) and houv.country || '_PROVINCE' = flv1.lookup_type (+)
3641: and houv.region_2 = flv2.lookup_code (+) and houv.country || '_STATE' = flv2.lookup_type (+)
3634: l_operating_unit_desc, l_operating_unit_add1,
3635: l_operating_unit_add2, l_operating_unit_add3, l_operating_unit_city,
3636: l_operating_unit_state,l_operating_unit_postal_code, l_operating_unit_country
3637: from hr_organization_units_v houv, fnd_territories_vl ftv, fnd_lookup_values_vl flv1, fnd_lookup_values_vl flv2,
3638: fnd_lookup_values_vl flv3
3639: where
3640: houv.region_1 = flv1.lookup_code (+) and houv.country || '_PROVINCE' = flv1.lookup_type (+)
3641: and houv.region_2 = flv2.lookup_code (+) and houv.country || '_STATE' = flv2.lookup_type (+)
3642: and houv.region_1 = flv3.lookup_code (+) and houv.country || '_COUNTY' = flv3.lookup_type (+)
3680: l_bill_to_region2
3681: from hr_locations_all hrl,
3682: hr_locations_all_tl hlt,
3683: fnd_territories_vl ftv,
3684: fnd_lookup_values_vl flv1,
3685: fnd_lookup_values_vl flv2,
3686: fnd_lookup_values_vl flv3,
3687: fnd_lookup_values_vl flv4
3688: where hrl.region_1 = flv1.lookup_code (+)
3681: from hr_locations_all hrl,
3682: hr_locations_all_tl hlt,
3683: fnd_territories_vl ftv,
3684: fnd_lookup_values_vl flv1,
3685: fnd_lookup_values_vl flv2,
3686: fnd_lookup_values_vl flv3,
3687: fnd_lookup_values_vl flv4
3688: where hrl.region_1 = flv1.lookup_code (+)
3689: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3682: hr_locations_all_tl hlt,
3683: fnd_territories_vl ftv,
3684: fnd_lookup_values_vl flv1,
3685: fnd_lookup_values_vl flv2,
3686: fnd_lookup_values_vl flv3,
3687: fnd_lookup_values_vl flv4
3688: where hrl.region_1 = flv1.lookup_code (+)
3689: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3690: and hrl.location_id = hlt.location_id
3683: fnd_territories_vl ftv,
3684: fnd_lookup_values_vl flv1,
3685: fnd_lookup_values_vl flv2,
3686: fnd_lookup_values_vl flv3,
3687: fnd_lookup_values_vl flv4
3688: where hrl.region_1 = flv1.lookup_code (+)
3689: and hrl.country || '_PROVINCE' = flv1.lookup_type (+)
3690: and hrl.location_id = hlt.location_id
3691: and hlt.language = USERENV('LANG')