tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ft_vw_drainage_system_insert()
Parameters
Name
Type
Mode
IN
Definition
BEGIN INSERT INTO tww_od.zone ( obj_id , fk_dataowner , fk_provider , identifier , last_modification , remark ) VALUES ( COALESCE( NEW.obj_id, tww_app.generate_oid('tww_od'::text, 'drainage_system'::text) ) , NEW.fk_dataowner , NEW.fk_provider , CASE WHEN NEW.identifier IS NOT NULL AND NEW.identifier::text <> '' THEN NEW.identifier ELSE COALESCE( NEW.obj_id, tww_app.generate_oid('tww_od'::text, 'drainage_system'::text) ) END , NEW.last_modification , NEW.remark ) RETURNING obj_id INTO NEW.obj_id; INSERT INTO tww_od.drainage_system ( obj_id , kind , perimeter_geometry ) VALUES ( NEW.obj_id , NEW.kind , NEW.perimeter_geometry ); RETURN NEW; END;