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()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值