681:
682:
683: --R12: mkothari -- added cursor to get territory org
684: CURSOR client_info_csr IS select org_id from jtf_terr_all where terr_id = p_terr_id;
685: l_terr_limited_to_ou VARCHAR2(1) := NVL(FND_PROFILE.VALUE('OZF_TP_TERR_LIMITED_TO_OU'), 'N');
686:
687: BEGIN
688: --
689: p_retcode := 0;
1674: l_index NUMBER;
1675: CURSOR c_get_object_ids IS
1676: SELECT subject_id
1677: FROM hz_relationships
1678: WHERE relationship_code = fnd_profile.VALUE('OZF_PARTY_RELATIONS_TYPE')
1679: AND subject_type = 'ORGANIZATION'
1680: AND subject_table_name = 'HZ_PARTIES'
1681: AND object_type = 'ORGANIZATION'
1682: AND object_table_name = 'HZ_PARTIES'
2009: errbuf := null;
2010: retcode := 0;
2011: /* yzhao: 08/07/2002 fix bug 2503141 performance issue. Use index on relationship_type */
2012: l_direction_code := NULL;
2013: l_rel_profile := fnd_profile.VALUE('OZF_PARTY_RELATIONS_TYPE');
2014: OPEN c_get_relationship_type(l_rel_profile);
2015: FETCH c_get_relationship_type INTO l_rel_type, l_direction_code;
2016: CLOSE c_get_relationship_type;
2017: IF p_bg_id IS NOT NULL THEN