MySQL Forums
Forum List  »  General

Re: Number of transaction records
Posted by: Claudinei Silva
Date: February 25, 2017 09:44PM

Friend / Peter Brawley / Jon Stephens

Come who could help me, because of the problem with ROW_COUNT (), see would it be need me to do something setup, service pack or hotfix to fix this problem?
I have a problem with ROW_COUNT () with heidisql, as the link below, as identification, but I realize that with visual studio using stored procedure debug I also have the same problem, and the LAST_INSERT_ID returns correctly.
What should I do to get the rown_count return correctly, I am using mysql 5.5.20.

https://www.heidisql.com/forum.php?t=9791
http://stackoverflow.com/questions/23884734/mysql-row-count-function-always-returning-0




CREATE DEFINER=`root`@`localhost` PROCEDURE `InsertAnimals`(
IN `dsName` CHAR(30),
OUT `idRegistro` INTEGER(11),
OUT `qtRegistro` INTEGER(11)

)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
DECLARE current_run_time_start DATETIME DEFAULT SYSDATE();
START TRANSACTION;

INSERT INTO animals(Name)
VALUES (concat(dsName,repeat("-",12)));

set qtRegistro = ROW_COUNT();
If (@@error_count > 0) then
rollback;
set idRegistro = 0;
else
commit;
set idRegistro = LAST_INSERT_ID();
end if;
select idregistro,qtRegistro;
END

Options: ReplyQuote


Subject
Written By
Posted
Re: Number of transaction records
February 25, 2017 09:44PM


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.