251: org_psite_rec hz_party_site_v2pub.party_site_rec_type := p_org_psite_rec;
252: language_rec hz_person_info_v2pub.person_language_rec_type := p_language_rec;
253: org_party_site_phone_rec hz_contact_point_v2pub.phone_rec_type := p_org_party_site_phone_rec;
254:
255: l_address_key hz_locations.address_key%TYPE ;
256: l_address_key_count NUMBER ;
257:
258: x_b2b varchar(1);
259: x_rented_list_flag varchar(1) := 0;
1382: p_msg_data => 'Create Location for Organization : Check existence for key '||l_address_key ,
1383: p_msg_type => 'DEBUG');
1384:
1385:
1386: select count(*) INTO l_address_key_count from hz_locations where address_key=l_address_key;
1387:
1388: if l_address_key_count =0 then
1389:
1390: AMS_Utility_PVT.Create_Log (
1409: end if;
1410: else
1411: if l_rec_update_flag = 'Y' and x_org_location_id is not NULL then
1412: select OBJECT_VERSION_NUMBER into l_loc_obj_number
1413: from hz_locations
1414: where location_id = x_org_location_id;
1415: org_location_rec.location_id := x_org_location_id;
1416: hz_location_v2pub.update_location(
1417: 'F',
1522: end if; -- if location_rec.address1 is not NULL
1523: else
1524: if l_rec_update_flag = 'Y' and x_location_id is not NULL then
1525: select OBJECT_VERSION_NUMBER into l_loc_obj_number
1526: from hz_locations
1527: where location_id = x_location_id;
1528: location_rec.location_id := x_location_id;
1529: hz_location_v2pub.update_location(
1530: 'F',
2565: end if; -- if location_rec.address1 is not NULL
2566: else
2567: if l_rec_update_flag = 'Y' and x_location_id is not NULL then
2568: select OBJECT_VERSION_NUMBER into l_loc_obj_number
2569: from hz_locations
2570: where location_id = x_location_id;
2571: location_rec.location_id := x_location_id;
2572: hz_location_v2pub.update_location(
2573: 'F',
2996: x_per_party_id number;
2997: x_party_id number;
2998:
2999: cursor c_address_country is
3000: select max(psite.party_id) from hz_party_sites psite, hz_locations loc,
3001: hz_parties party
3002: where psite.location_id = loc.location_id
3003: and loc.address1 = p_address1
3004: and loc.country = p_country
3009:
3010: -- sranka 1/13/2003 created new cursor c_address_country_with_osr for including the orig_system_reference for duplication check
3011:
3012: cursor c_address_country_with_osr is
3013: select max(psite.party_id) from hz_party_sites psite, hz_locations loc,
3014: hz_parties party
3015: where psite.location_id = loc.location_id
3016: and loc.address1 = p_address1
3017: and loc.country = p_country
3021: and psite.party_id = party.party_id
3022: and party.orig_system_reference = p_orig_system_reference;
3023:
3024: cursor c_country is
3025: select max(psite.party_id) from hz_party_sites psite, hz_locations loc,
3026: hz_parties party
3027: where psite.location_id = loc.location_id
3028: and loc.country = p_country
3029: and party.customer_key = l_party_key
3034: -- sranka 1/13/2003
3035: -- created new cursor c_country_with_osr for including the orig_system_reference for duplication check
3036:
3037: cursor c_country_with_osr is
3038: select max(psite.party_id) from hz_party_sites psite, hz_locations loc,
3039: hz_parties party
3040: where psite.location_id = loc.location_id
3041: and loc.country = p_country
3042: and party.customer_key = l_party_key
4430: and nvl(cp.phone_area_code,nvl(p_ph_area_code,'x')) = nvl(p_ph_area_code,'x');
4431: */
4432:
4433: cursor c_address_country is
4434: select max(psite.party_id) from hz_party_sites psite, hz_locations loc,
4435: hz_parties party
4436: where psite.location_id = loc.location_id
4437: and loc.address1 = p_address1
4438: and loc.country = p_country
4441: and party.status = 'A'
4442: and psite.party_id = party.party_id;
4443:
4444: cursor c_address_country_with_osr is
4445: select max(psite.party_id) from hz_party_sites psite, hz_locations loc,
4446: hz_parties party
4447: where psite.location_id = loc.location_id
4448: and loc.address1 = p_address1
4449: and loc.country = p_country
4696: and nvl(cp.phone_area_code,nvl(p_ph_area_code,'x')) = nvl(p_ph_area_code,'x');
4697: */
4698:
4699: cursor c_address_country is
4700: select max(p2.party_id) from hz_party_sites psite, hz_locations loc,
4701: hz_parties party, hz_relationships hr, hz_parties p2
4702: where psite.location_id = loc.location_id
4703: and loc.address1 = p_address1
4704: and loc.country = p_country
4712: and hr.relationship_code = 'CONTACT_OF'
4713: and hr.subject_id = p2.party_id;
4714:
4715: cursor c_address_country_with_osr is
4716: select max(p2.party_id) from hz_party_sites psite, hz_locations loc,
4717: hz_parties party, hz_relationships hr, hz_parties p2
4718: where psite.location_id = loc.location_id
4719: and loc.address1 = p_address1
4720: and loc.country = p_country