Skip to content

Commit

Permalink
wrap execute format in begin/end
Browse files Browse the repository at this point in the history
  • Loading branch information
cymed committed Apr 16, 2024
1 parent ee02943 commit c30695b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion datamodel/app/view/vw_tww_additional_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def vw_tww_additional_ws(srid: int, pg_service: str = None):
IF OLD.ws_type <> NEW.ws_type THEN
CASE WHEN OLD.ws_type <> 'unknown' THEN
EXECUTE FORMAT('DELETE FROM tww_od.%%I WHERE obj_id = %%L',OLD.ws_type,OLD.obj_id);
BEGIN
EXECUTE FORMAT('DELETE FROM tww_od.%%I WHERE obj_id = %%L',OLD.ws_type,OLD.obj_id);
END;
END CASE;
CASE WHEN NEW.ws_type = ANY(ARRAY['manhole','special_structure','discharge_point','infiltration_installation','drainless_toilet','wwtp_structure','small_treatment_plant']) THEN
Expand Down
4 changes: 3 additions & 1 deletion datamodel/app/view/vw_tww_wastewater_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ def vw_tww_wastewater_structure(srid: int, pg_service: str = None, extra_definit
IF OLD.ws_type <> NEW.ws_type THEN
CASE WHEN OLD.ws_type <> 'unknown' THEN
EXECUTE FORMAT('DELETE FROM tww_od.%%I WHERE obj_id = %%L',OLD.ws_type,OLD.obj_id);
BEGIN
EXECUTE FORMAT('DELETE FROM tww_od.%%I WHERE obj_id = %%L',OLD.ws_type,OLD.obj_id);
END;
END CASE;
CASE WHEN NEW.ws_type = ANY(ARRAY['manhole','special_structure','discharge_point','infiltration_installation','drainless_toilet','wwtp_structure','small_treatment_plant']) THEN
Expand Down

0 comments on commit c30695b

Please sign in to comment.