Mercurial > dive4elements > river
diff flys-backend/doc/schema/oracle-spatial.sql @ 5038:57a845da72bd dami
Fix some oracle syntax problems and move indicies to _idx.sql
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 20 Feb 2013 10:44:04 +0100 |
parents | a5f438895a38 |
children | 0fd7720e5c7f |
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql Wed Feb 20 10:43:00 2013 +0100 +++ b/flys-backend/doc/schema/oracle-spatial.sql Wed Feb 20 10:44:04 2013 +0100 @@ -1,4 +1,4 @@ -WHENEVER SQLERROR EXIT SQL.ERRORCODE ROLLBACK; +WHENEVER SQLERROR EXIT; -- Geodaesie/Flussachse+km/achse CREATE SEQUENCE RIVER_AXES_ID_SEQ; CREATE TABLE river_axes( @@ -200,13 +200,11 @@ description VARCHAR(256) ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('hws_lines', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); -CREATE INDEX hws_lines_spatial_idx ON hws_lines(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE'); - CREATE OR REPLACE TRIGGER hws_lines_trigger BEFORE INSERT ON hws_lines FOR each ROW BEGIN SELECT HWS_LINES_ID_SEQ.nextval INTO :new.id FROM dual; END; - +/ -- HWS Points lookup tables CREATE TABLE sectie_kinds ( id NUMBER PRIMARY KEY NOT NULL, @@ -234,7 +232,6 @@ INSERT INTO boundary_kinds (id, name) VALUES (2, 'Land'); INSERT INTO boundary_kinds (id, name) VALUES (3, 'Sonstige'); - -- HWS Points CREATE SEQUENCE HWS_POINTS_ID_SEQ; CREATE TABLE hws_points ( @@ -261,13 +258,12 @@ ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('hws_points', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); -CREATE INDEX hws_lines_spatial_idx ON hws_pints(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POINT'); -CREATE OR REPLACE TRIGGER hws_lines_trigger BEFORE INSERT ON hws_lines FOR each ROW +CREATE OR REPLACE TRIGGER hws_points_trigger BEFORE INSERT ON hws_points FOR each ROW BEGIN - SELECT HWS_LINES_ID_SEQ.nextval INTO :new.id FROM dual; + SELECT HWS_POINTS_ID_SEQ.nextval INTO :new.id FROM dual; END; - +/ --Hydrologie/UeSG CREATE SEQUENCE FLOODMAPS_ID_SEQ; @@ -289,9 +285,7 @@ BEGIN SELECT FLOODMAPS_ID_SEQ.nextval INTO :new.id FROM dual; END; - -CREATE INDEX floodmaps_spatial_idx ON floodmaps(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=MULTIPOLYGON'); - +/ --Hydrologie/Hydr.Grenzen/Linien CREATE SEQUENCE HYDR_BOUNDARIES_ID_SEQ; @@ -309,8 +303,7 @@ BEGIN SELECT HYDR_BOUNDARIES_ID_SEQ.nextval INTO :new.id FROM dual; END; - -CREATE INDEX hydr_boundaries_idx ON hydr_boundaries(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE'); +/ CREATE SEQUENCE HYDR_BOUNDARIES_POLY_ID_SEQ; CREATE TABLE hydr_boundaries_poly ( @@ -327,9 +320,7 @@ BEGIN SELECT HYDR_BOUNDARIES_POLY_ID_SEQ.nextval INTO :new.id FROM dual; END; - -CREATE INDEX hydr_boundaries_poly_idx ON hydr_boundaries_poly(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=MULTIPOLYGON'); - +/ -- Hydrologie/Streckendaten/ CREATE SEQUENCE GAUGE_LOCATION_ID_SEQ; @@ -346,5 +337,4 @@ BEGIN SELECT GAUGE_LOCATION_ID_SEQ.nextval INTO :new.id FROM dual; END; - -CREATE INDEX gauge_location_idx ON gauge_location(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POINT'); +/