tww
.tww_app
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
symbology_update_by_reach_point()
Parameters
Name
Type
Mode
IN
Definition
DECLARE _ne_id TEXT; rp_obj_id TEXT; BEGIN CASE WHEN TG_OP = 'UPDATE' THEN rp_obj_id = OLD.obj_id; WHEN TG_OP = 'INSERT' THEN rp_obj_id = NEW.obj_id; WHEN TG_OP = 'DELETE' THEN rp_obj_id = OLD.obj_id; END CASE; BEGIN SELECT ne.obj_id INTO STRICT _ne_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 = rp_obj_id; EXECUTE tww_app.update_wastewater_node_symbology(_ne_id); EXCEPTION WHEN NO_DATA_FOUND THEN -- DO NOTHING, THIS CAN HAPPEN WHEN TOO_MANY_ROWS THEN RAISE EXCEPTION 'TRIGGER ERROR ws_symbology_update_by_reach_point. Subquery shoud return exactly one row. This is not supposed to happen and indicates an isue with the trigger. The issue must be fixed in TWW.'; END; RETURN NEW; END;