tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ft_vw_tww_overflow_delete()
Parameters
Name
Type
Mode
IN
Definition
BEGIN CASE WHEN OLD.overflow_type = 'leapingweir'::tww_app.overflow_type THEN DELETE FROM tww_od.leapingweir WHERE obj_id = OLD.obj_id; WHEN OLD.overflow_type = 'prank_weir'::tww_app.overflow_type THEN DELETE FROM tww_od.prank_weir WHERE obj_id = OLD.obj_id; WHEN OLD.overflow_type = 'pump'::tww_app.overflow_type THEN DELETE FROM tww_od.pump WHERE obj_id = OLD.obj_id; END CASE; DELETE FROM tww_od.overflow WHERE obj_id = OLD.obj_id; RETURN NULL; END;