MySQL :: @@Rowcount in MySQL

@@Rowcount in MySQL?
Posted by:  Thomas De Scheemaeker ()
Date: September 19, 2005 06:43AM

Hi Everyone, 

I'm trying to convert some stored procedures from MSSQL to MySql and one of them uses the MSSQL @@ROWCOUNT variable to test the amount of rows affected by an update statement. This number then decides the further flow of the stored procedure. 

Is there any MySQL alternative to this? I can't seem to find any mention of this in the manual. 

Regards, 

Thomas

Re: @@Rowcount in MySQL?
Posted by:  Jay Pipes ()
Date: September 19, 2005 07:09AM

You can use the FOUND_ROWS() construct after putting a SQL_CALC_FOUND_ROWS in a SELECT statement, or you can simply do a SELECT @my_count:=COUNT(*) FROM my_table WHERE ... and then use the user variable in your procedure logic.

Jay Pipes 
Community Relations Manager, North America, MySQL Inc. 

Got Cluster?  http://www.mysql.com/cluster 
Personal:  http://jpipes.com
Re: @@Rowcount in MySQL?
Posted by:  Li Min ()
Date: September 14, 2007 03:51AM

select -> found_rows() 

update/insert/delete -> row_count()

你可能感兴趣的:(sql,mysql)