MySQL Forums
Forum List  »  Stored Procedures

rows matched
Posted by: Srivats Chandrasekaran
Date: December 07, 2005 03:10AM

1. if exist ( select *.....) then

update...

else

insert

or

2. update ...

if row_count() = 0 then

insert

Will the 2nd method be faster than the first in terms of execution speed. But the problem is sometimes
when an update happens with no change in data mySql returns 0 in the row count and row matched as 1. Is there any way i can check the row_matched like the way i can check the row_count or I can make mySql return the row_matched in the row_count variable.

Thks

Options: ReplyQuote


Subject
Views
Written By
Posted
rows matched
3557
December 07, 2005 03:10AM
1640
December 07, 2005 04:11AM


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.