tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ft_vw_tww_maintenance_event_delete()
Parameters
Name
Type
Mode
IN
Definition
BEGIN CASE WHEN OLD.maintenance_event_type = 'bio_ecol_assessment'::tww_app.maintenance_event_type THEN DELETE FROM tww_od.bio_ecol_assessment WHERE obj_id = OLD.obj_id; WHEN OLD.maintenance_event_type = 'examination'::tww_app.maintenance_event_type THEN DELETE FROM tww_od.examination WHERE obj_id = OLD.obj_id; WHEN OLD.maintenance_event_type = 'maintenance'::tww_app.maintenance_event_type THEN DELETE FROM tww_od.maintenance WHERE obj_id = OLD.obj_id; END CASE; DELETE FROM tww_od.maintenance_event WHERE obj_id = OLD.obj_id; RETURN NULL; END;