tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ft_vw_examination_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, 'examination'::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.examination ( obj_id , equipment , fk_reach_point , from_point_identifier , inspected_length , recording_type , to_point_identifier , vehicle , videonumber , weather ) VALUES ( NEW.obj_id , NEW.equipment , NEW.fk_reach_point , NEW.from_point_identifier , NEW.inspected_length , NEW.recording_type , NEW.to_point_identifier , NEW.vehicle , NEW.videonumber , NEW.weather ); RETURN NEW; END;