END IF;
IF out_parent_place_id IS NULL THEN
- FOR location IN SELECT place_id FROM getNearestParellelRoadFeature(out_partition, linegeo) LOOP
- out_parent_place_id := location.place_id;
- END LOOP;
+ SELECT getNearestParallelRoadFeature(out_partition, linegeo)
+ INTO out_parent_place_id;
END IF;
IF out_parent_place_id IS NULL THEN
- FOR location IN SELECT place_id FROM getNearestRoadFeature(out_partition, place_centroid) LOOP
- out_parent_place_id := location.place_id;
- END LOOP;
+ SELECT getNearestRoadPlaceId(out_partition, place_centroid)
+ INTO out_parent_place_id;
END IF;
--insert street(line) into import table