476: BEGIN
477:
478: l_location := Upper(REPLACE(l_location,'''','''''')); --bug # 9962727
479: l_country := Upper(REPLACE(l_country,'''','''''')); --bug #9980633
480: l_stmt := 'select location_id from ap_pol_locations_vl '||
481: 'where location_type = '''|| p_location_type ||''''; --bug #9980633
482:
483: IF(p_location_type = 'CITY') THEN
484: l_validate_where := ' AND upper(location) LIKE '''|| l_location ||'%''';
540: l_city_locality_id NUMBER;
541:
542: CURSOR undefined_conus_cur IS
543: select location_id
544: from ap_pol_locations_vl
545: where city_locality_id = l_city_locality_id
546: and territory_code = 'US'
547: and rownum = 1;
548:
592: ------------------------------------------------------------------------
593:
594: CURSOR undefined_cur IS
595: select location_id
596: from ap_pol_locations_vl
597: where undefined_location_flag = 'Y'
598: and territory_code is null
599: and rownum = 1;
600:
635: ------------------------------------------------------------------------
636:
637: CURSOR loc_status_cur IS
638: select status
639: from ap_pol_locations_vl
640: where location_id = p_location_id;
641:
642: loc_status_rec loc_status_cur%ROWTYPE;
643: