tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ft_vw_building_insert()
Parameters
Name
Type
Mode
IN
Definition
BEGIN INSERT INTO tww_od.connection_object ( obj_id , fk_dataowner , fk_provider , fk_wastewater_networkelement , identifier , last_modification , remark , sewer_infiltration_water_production ) VALUES ( COALESCE( NEW.obj_id, tww_app.generate_oid('tww_od'::text, 'building'::text) ) , NEW.fk_dataowner , NEW.fk_provider , NEW.fk_wastewater_networkelement , 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, 'building'::text) ) END , NEW.last_modification , NEW.remark , NEW.sewer_infiltration_water_production ) RETURNING obj_id INTO NEW.obj_id; INSERT INTO tww_od.building ( obj_id , house_number , location_name , perimeter_geometry , reference_point_geometry ) VALUES ( NEW.obj_id , NEW.house_number , NEW.location_name , NEW.perimeter_geometry , NEW.reference_point_geometry ); RETURN NEW; END;