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