update A set x = '0' where [condition];
if the where-condition isn't fulfilled no update takes place.
depending on this I want to trigger an insert in another table, but only if an update was done - i.e. ROW_COUNT() > 0.
how may I do that in one request?
I tried this:
update A set x = '0' where [condition];
if row_count() > 0 then
insert into [...];
end if;
this leads to an error.
PS:
The question is purely aming at a possibility to to execute an update and a conditional insert in one db-request. SQL-Injection-safty is assured by using prepared statements.