tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
symbology_on_reach_change()
Parameters
Name
Type
Mode
IN
Definition
DECLARE rp_obj_ids TEXT[]; _ws_obj_id TEXT; rps RECORD; BEGIN CASE WHEN TG_OP = 'UPDATE' THEN rp_obj_ids = ARRAY[OLD.fk_reach_point_from, OLD.fk_reach_point_to]; WHEN TG_OP = 'INSERT' THEN rp_obj_ids = ARRAY[NEW.fk_reach_point_from, NEW.fk_reach_point_to]; WHEN TG_OP = 'DELETE' THEN rp_obj_ids = ARRAY[OLD.fk_reach_point_from, OLD.fk_reach_point_to]; END CASE; FOR _ws_obj_id IN SELECT ws.obj_id FROM tww_od.wastewater_structure ws LEFT JOIN tww_od.wastewater_networkelement ne ON ws.obj_id = ne.fk_wastewater_structure LEFT JOIN tww_od.reach_point rp ON ne.obj_id = rp.fk_wastewater_networkelement WHERE rp.obj_id = ANY ( rp_obj_ids ) LOOP EXECUTE tww_app.update_wastewater_structure_label(_ws_obj_id); EXECUTE tww_app.update_depth(_ws_obj_id); END LOOP; RETURN NEW; END;