Index: unk/data/konvert/trigger_unique_id.sql
===================================================================
--- /trunk/data/konvert/trigger_unique_id.sql	(revision 231)
+++ 	(revision )
@@ -1,56 +1,0 @@
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--- 
--- unique_id - Eindeutigkeit von "gml_id", "beginnt" und "endet" 
---             sicherstellen und Historie auf Basis der "gml_id" pflegen
---           - allgemeiner Trigger fÃŒr alle Tabellen auÃer "alkis_beziehungen"
---
--- Fr. Nov 4 2011 ralf dot suhr at itc-halle dot de
---
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-SET client_encoding = 'UTF-8';
-
-
-CREATE OR REPLACE FUNCTION public.unique_id()
-  RETURNS TRIGGER AS
-$$
-DECLARE
-  _test       boolean;
-BEGIN
-
-  IF NEW.gml_id IS NULL THEN
-    RAISE NOTICE 'Leere gml_id in % abgelehnt', TG_RELNAME;
-    RETURN NULL;
-  END IF;
-
-  -- doppelte DatensÃ€tze vermeiden (auch NBA)
-  FOR _test IN EXECUTE '
-      SELECT TRUE
-      FROM public.' || TG_RELNAME || '
-      WHERE gml_id = ''' || substr(NEW.gml_id, 1 , 16) || ''' AND
-        beginnt = ''' || NEW.beginnt || ''' AND
-        endet IS NULL
-      LIMIT 1' LOOP
-    -- Abarbeitung beenden
-    RETURN NULL;
-  END LOOP;
-
-  -- auf NBA Update testen
-  IF char_length(NEW.gml_id) > 18 THEN
-    NEW.gml_id := substr(NEW.gml_id, 1 , 16);
-    -- abgelaufenen Datensatz markieren (Enddatum setzen)
-    EXECUTE 'UPDATE public.' || TG_RELNAME || ' SET endet = ''' || NEW.beginnt || '''
-      WHERE gml_id = ''' || NEW.gml_id || ''' AND endet IS NULL';
-  END IF;
-
-  -- Lebenszeitintervall nachtragen (ATKIS)
-  IF NEW.beginnt IS NULL THEN
-    NEW.beginnt := NOW()::text;
-  END IF;
-
-  -- alles zurÃŒckgeben
-  RETURN NEW;
-END;
-$$
-LANGUAGE 'plpgsql';
Index: unk/data/konvert/transaction_delete.sql
===================================================================
--- /trunk/data/konvert/transaction_delete.sql	(revision 231)
+++ 	(revision )
@@ -1,41 +1,0 @@
-﻿-- Table: "delete"
-
--- DROP TABLE "delete";
-
-CREATE TABLE "delete"
-(
-  ogc_fid serial NOT NULL,
-  typename character(255),
-  featureid character(32),
-  CONSTRAINT delete_pk PRIMARY KEY (ogc_fid)
-);
-
-DROP FUNCTION deletefeature(text, text);
-CREATE FUNCTION deleteFeature(typename text, featureid text) RETURNS text 
-AS $$ 
- DECLARE 
-  query text;
-  res text; 
- BEGIN 
-     query := 'DELETE FROM ' || $1 || ' WHERE gml_id = substring(''' || $2 || ''' from 1 for 16)';
-     EXECUTE query;
-
-     IF FOUND THEN 
-	RAISE NOTICE 'query successfull % ', query; 
-	res := 1;
-     ELSE 
-        RAISE NOTICE 'query no object found % ', query; 
-        res := 0;
-     END IF; 
-  RETURN res; 
- END; 
-$$ LANGUAGE plpgsql; 
-
--- example
---INSERT INTO AA_Antragsgebiet (gml_id) VALUES ('DENW44AL0000okRc');
---INSERT INTO delete (typename, featureid) VALUES ('AA_Antragsgebiet','DENW44AL0000okRc20110428T135110Z');
---Select deleteFeature('AA_Antragsgebiet','DENW44AL0000okRc20110428T135110Z');
---INSERT INTO AA_Antragsgebiet (gml_id) VALUES ('DENW44AL0000okRc');
---Select * from AA_Antragsgebiet
-
-Select deleteFeature(typename,featureid) from delete;
Index: /branches/0.6/data/konvert/trigger_unique_id.sql
===================================================================
--- /branches/0.6/data/konvert/trigger_unique_id.sql	(revision 232)
+++ /branches/0.6/data/konvert/trigger_unique_id.sql	(revision 232)
@@ -0,0 +1,56 @@
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-- 
+-- unique_id - Eindeutigkeit von "gml_id", "beginnt" und "endet" 
+--             sicherstellen und Historie auf Basis der "gml_id" pflegen
+--           - allgemeiner Trigger fÃŒr alle Tabellen auÃer "alkis_beziehungen"
+--
+-- Fr. Nov 4 2011 ralf dot suhr at itc-halle dot de
+--
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+SET client_encoding = 'UTF-8';
+
+
+CREATE OR REPLACE FUNCTION public.unique_id()
+  RETURNS TRIGGER AS
+$$
+DECLARE
+  _test       boolean;
+BEGIN
+
+  IF NEW.gml_id IS NULL THEN
+    RAISE NOTICE 'Leere gml_id in % abgelehnt', TG_RELNAME;
+    RETURN NULL;
+  END IF;
+
+  -- doppelte DatensÃ€tze vermeiden (auch NBA)
+  FOR _test IN EXECUTE '
+      SELECT TRUE
+      FROM public.' || TG_RELNAME || '
+      WHERE gml_id = ''' || substr(NEW.gml_id, 1 , 16) || ''' AND
+        beginnt = ''' || NEW.beginnt || ''' AND
+        endet IS NULL
+      LIMIT 1' LOOP
+    -- Abarbeitung beenden
+    RETURN NULL;
+  END LOOP;
+
+  -- auf NBA Update testen
+  IF char_length(NEW.gml_id) > 18 THEN
+    NEW.gml_id := substr(NEW.gml_id, 1 , 16);
+    -- abgelaufenen Datensatz markieren (Enddatum setzen)
+    EXECUTE 'UPDATE public.' || TG_RELNAME || ' SET endet = ''' || NEW.beginnt || '''
+      WHERE gml_id = ''' || NEW.gml_id || ''' AND endet IS NULL';
+  END IF;
+
+  -- Lebenszeitintervall nachtragen (ATKIS)
+  IF NEW.beginnt IS NULL THEN
+    NEW.beginnt := NOW()::text;
+  END IF;
+
+  -- alles zurÃŒckgeben
+  RETURN NEW;
+END;
+$$
+LANGUAGE 'plpgsql';
Index: /branches/0.6/data/konvert/transaction_delete.sql
===================================================================
--- /branches/0.6/data/konvert/transaction_delete.sql	(revision 232)
+++ /branches/0.6/data/konvert/transaction_delete.sql	(revision 232)
@@ -0,0 +1,41 @@
+﻿-- Table: "delete"
+
+-- DROP TABLE "delete";
+
+CREATE TABLE "delete"
+(
+  ogc_fid serial NOT NULL,
+  typename character(255),
+  featureid character(32),
+  CONSTRAINT delete_pk PRIMARY KEY (ogc_fid)
+);
+
+DROP FUNCTION deletefeature(text, text);
+CREATE FUNCTION deleteFeature(typename text, featureid text) RETURNS text 
+AS $$ 
+ DECLARE 
+  query text;
+  res text; 
+ BEGIN 
+     query := 'DELETE FROM ' || $1 || ' WHERE gml_id = substring(''' || $2 || ''' from 1 for 16)';
+     EXECUTE query;
+
+     IF FOUND THEN 
+	RAISE NOTICE 'query successfull % ', query; 
+	res := 1;
+     ELSE 
+        RAISE NOTICE 'query no object found % ', query; 
+        res := 0;
+     END IF; 
+  RETURN res; 
+ END; 
+$$ LANGUAGE plpgsql; 
+
+-- example
+--INSERT INTO AA_Antragsgebiet (gml_id) VALUES ('DENW44AL0000okRc');
+--INSERT INTO delete (typename, featureid) VALUES ('AA_Antragsgebiet','DENW44AL0000okRc20110428T135110Z');
+--Select deleteFeature('AA_Antragsgebiet','DENW44AL0000okRc20110428T135110Z');
+--INSERT INTO AA_Antragsgebiet (gml_id) VALUES ('DENW44AL0000okRc');
+--Select * from AA_Antragsgebiet
+
+Select deleteFeature(typename,featureid) from delete;
