tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ft_vw_access_aid_insert()
Parameters
Name
Type
Mode
IN
Definition
BEGIN INSERT INTO tww_od.structure_part ( obj_id , fk_dataowner , fk_provider , fk_wastewater_structure , identifier , last_modification , remark , renovation_demand ) VALUES ( COALESCE( NEW.obj_id, tww_app.generate_oid('tww_od'::text, 'access_aid'::text) ) , NEW.fk_dataowner , NEW.fk_provider , NEW.fk_wastewater_structure , 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, 'access_aid'::text) ) END , NEW.last_modification , NEW.remark , NEW.renovation_demand ) RETURNING obj_id INTO NEW.obj_id; INSERT INTO tww_od.access_aid ( obj_id , kind ) VALUES ( NEW.obj_id , NEW.kind ); RETURN NEW; END;