Thread: several requests with different parameters

several requests with different parameters

From
"Ludger Sonntag"
Date:
Hi all,


I'd like to run the following steps automatically and, if possible, in one step. But I don't know how.

Step 1:


CREATE TABLE table_1 AS
SELECT *
   FROM vertices_tmp
   JOIN
   (SELECT * FROM driving_distance('
      SELECT ogc_fid AS id,
          source::int4 AS source,
          target::int4 AS target,
          traveltime::float8 AS cost
      FROM strassenl_dachraum_erweitert_ohne_autobahn',
      25080,
      60,
      false,
      false)) AS route
   ON
   vertices_tmp.id = route.vertex_id

Step 1 has to run 500 times with different values for the 5 digit number (here 25080) and a changing table name (table_
+ascending number). The 5 digit number is received from another table (vertices_tmp). 


Step 2:

Schritt 2:
CREATE TABLE catchment_union AS
SELECT id,the_geom,cost FROM table_1
UNION ALL
SELECT id,the_geom,cost FROM table_2
UNION ALL
SELECT id,the_geom,cost FROM table_3
...
...

In step 2 the tables received in step 1 are merged with UNION.
How can I do that automatically?

I am grateful for any help.

Cheers,
Lu
___________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192