tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ft_vw_backflow_prevention_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, 'backflow_prevention'::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, 'backflow_prevention'::text) ) END , NEW.last_modification , NEW.remark , NEW.renovation_demand ) RETURNING obj_id INTO NEW.obj_id; INSERT INTO tww_od.backflow_prevention ( obj_id , fk_pump , fk_throttle_shut_off_unit , gross_costs , kind , year_of_replacement ) VALUES ( NEW.obj_id , NEW.fk_pump , NEW.fk_throttle_shut_off_unit , NEW.gross_costs , NEW.kind , NEW.year_of_replacement ); RETURN NEW; END;