MySQL Forums
Forum List  »  InnoDB

Re: Can insert update a table based on match of one column value?
Posted by: Peter Brawley
Date: February 07, 2019 07:48PM

> if @@rowcount = 0 insert ....

Again, if...end if is available in mysql only in stored routines.

You can query mysql's rowcount() func after an update query to see how many rows were updated, but note that it will return 0 if the row you seek already exists with the value(s) you were updating it to.

> Peter said that stored procedure does not have good performance

No. I said they do not usually improve performance.

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.