[Dive4elements-commits] [PATCH] fixed DEM-importer to work with Oracle (made by A. Heinecke)

Wald Commits scm-commit at wald.intevation.org
Tue Mar 12 19:43:23 CET 2013


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1363113791 -3600
# Node ID 8f71fe38977ce2418d49db8c131e40eaa2e85f98
# Parent  7a11271f5593f7785f31b46e7595498453611929
fixed DEM-importer to work with Oracle (made by A. Heinecke)

diff -r 7a11271f5593 -r 8f71fe38977c flys-backend/contrib/shpimporter/dgm.py
--- 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
diff -r 7a11271f5593 -r 8f71fe38977c flys-backend/doc/schema/oracle-spatial.sql
--- 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),


More information about the Dive4elements-commits mailing list