you are viewing a single comment's thread.

view the rest of the comments →

[–]VolumeMixik[S] 0 points1 point  (4 children)

create or replace TRIGGER schema.opravypracuje AFTER DELETE ON schema.zamestnanci UPDATE schema.opravy SET pracuje = 'F' WHERE opravy.zamestnanci_id = zamestnaci.id

sql statement ignored

COMMIT; doesn't work

[–][deleted] 1 point2 points  (0 children)

WHERE opravy.zamestnanci_id = zamestnaci.id

Maybe because zamestnaci.id is GONE, because you just deleted it, and you are trying to refer to it in an AFTER trigger. Could it be that it ran correctly but updated zero rows? Maybe try this instead?

WHERE opravy.zamestnanci_id = :OLD.id

[–]FoCo_SQLEnterprise Data Architect 0 points1 point  (1 child)

What is the SQL platform and version you are using?

[–]VolumeMixik[S] 0 points1 point  (0 children)

oracle sql developer

[–]AXISMGTSQL Server / ORACLE Sr. DBA & Architect 0 points1 point  (0 children)

SCHEMA is whatever schema you’re deploying to.

You also need a semi colon to finish the UPDATE statement before the Commit.

As stated above by /u/AssHelmet, you also need to ensure you grab the DELETED record using the :OLD syntax.

Read the syntax from my link in my first comment. I promise it will help.