Answer the question
In order to leave comments, you need to log in
Error creating trigger..?
Can you see what's wrong with the trigger?
create trigger updater
AFTER INSERT
ON done_cars
for each row
update table2 set table2.counting=table2.counting+1 where table2.workshop_id=new.number;
ERROR: ОШИБКА: ошибка синтаксиса (примерное положение: "update")
LINE 5: update table2 set table2.counting=table2.counting+1 where ta...
Answer the question
In order to leave comments, you need to log in
Of course, it is not necessary to specify the DBMS, they are all the same ...
Apparently, postgres. If so, please read the documentation . Do you see an opportunity to write any DML queries directly in CREATE TRIGGER?
In postgres, all trigger actions are performed through a special function (links to examples in different languages - https://www.postgresql.org/docs/13/triggers.html ) that the trigger should call.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question