MySQL Forums
Forum List  »  InnoDB

Re: Can insert update a table based on match of one column value?
Posted by: Peter Brawley
Date: February 06, 2019 10:40AM

3 queries in a transaction, eg in an sproc ...

start transaction
select ... where readstatus=true for update;
if found_rows() > 0 then update ... set ...;
else insert ... set ...
end if;

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.