tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
symbology_on_cover_change()
Parameters
Name
Type
Mode
IN
Definition
DECLARE co_obj_id TEXT; affected_sp RECORD; BEGIN CASE WHEN TG_OP = 'UPDATE' THEN co_obj_id = OLD.obj_id; WHEN TG_OP = 'INSERT' THEN co_obj_id = NEW.obj_id; WHEN TG_OP = 'DELETE' THEN co_obj_id = OLD.obj_id; END CASE; SELECT SP.fk_wastewater_structure INTO affected_sp FROM tww_od.structure_part SP WHERE obj_id = co_obj_id; EXECUTE tww_app.update_wastewater_structure_label(affected_sp.fk_wastewater_structure); EXECUTE tww_app.update_depth(affected_sp.fk_wastewater_structure); EXECUTE tww_app.wastewater_structure_update_fk_main_cover(affected_sp.fk_wastewater_structure); RETURN NEW; END;