X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9abb96fa6b87ba2086b0bf32eed0310690931cfe..c3e276b23bb306bc777cf99fcf22cd7344c2246e:/sql/tiger_import_start.sql?ds=sidebyside

diff --git a/sql/tiger_import_start.sql b/sql/tiger_import_start.sql
index b9c4fcfc..4b9c33fc 100644
--- a/sql/tiger_import_start.sql
+++ b/sql/tiger_import_start.sql
@@ -63,15 +63,13 @@ BEGIN
   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
