tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ft_vw_maintenance_insert()
Parameters
Name
Type
Mode
IN
Definition
BEGIN INSERT INTO tww_od.maintenance_event ( obj_id , base_data , cost , data_details , duration , fk_dataowner , fk_measure , fk_operating_company , fk_provider , identifier , last_modification , operator , reason , remark , result , status , time_point ) VALUES ( COALESCE( NEW.obj_id, tww_app.generate_oid('tww_od'::text, 'maintenance'::text) ) , NEW.base_data , NEW.cost , NEW.data_details , NEW.duration , NEW.fk_dataowner , NEW.fk_measure , NEW.fk_operating_company , NEW.fk_provider , NEW.identifier , NEW.last_modification , NEW.operator , NEW.reason , NEW.remark , NEW.result , NEW.status , NEW.time_point ) RETURNING obj_id INTO NEW.obj_id; INSERT INTO tww_od.maintenance ( obj_id , kind ) VALUES ( NEW.obj_id , NEW.kind ); RETURN NEW; END;