changeset 5260:8f71fe38977c

fixed DEM-importer to work with Oracle (made by A. Heinecke)
author Tom Gottfried <tom@intevation.de>
date Tue, 12 Mar 2013 19:43:11 +0100
parents 7a11271f5593
children 1e403a0efc21
files flys-backend/contrib/shpimporter/dgm.py flys-backend/doc/schema/oracle-spatial.sql
diffstat 2 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/dgm.py	Tue Mar 12 19:16:05 2013 +0100
+++ b/flys-backend/contrib/shpimporter/dgm.py	Tue Mar 12 19:43:11 2013 +0100
@@ -55,16 +55,12 @@
 INSERT INTO ranges (id, river_id, a, b) VALUES (:s, :s, :s, :s)
 """
 SQL_NEXT_ID     = "SELECT coalesce(max(id), -1) + 1 FROM %s"
-SQL_NEXT_ID_ORA = "SELECT coalesce(max(id), -1) + 1 FROM :s"
 
 
 NEXT_IDS = {}
 def next_id(cur, relation, oracle):
     idx = NEXT_IDS.get(relation)
     if idx is None:
-        if oracle:
-            cur.execute(SQL_NEXT_ID_ORA % relation)
-        else:
             cur.execute(SQL_NEXT_ID % relation)
         idx = cur.fetchone()[0]
     NEXT_IDS[relation] = idx + 1
--- a/flys-backend/doc/schema/oracle-spatial.sql	Tue Mar 12 19:16:05 2013 +0100
+++ b/flys-backend/doc/schema/oracle-spatial.sql	Tue Mar 12 19:43:11 2013 +0100
@@ -152,7 +152,7 @@
     ID               NUMBER PRIMARY KEY NOT NULL,
     river_id         NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE,
     name             VARCHAR(64),
-    range_id         NUMBER(38) REFERENCES ranges(id);
+    range_id         NUMBER(38) REFERENCES ranges(id),
     time_interval_id NUMBER(38) REFERENCES time_intervals(id),
     projection       VARCHAR(32),
     elevation_state  VARCHAR(32),

http://dive4elements.wald.intevation.org