Friend
I'm running the stored procedure by debugging Visual Studio 2010 using MySQL 5.5.20 and I'm having a problem with the ROW_COUNT () function where it's always returning 0 (zero) would anyone know why?
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
I'm running the stored procedure by debugging Visual Studio 2010 using MySQL 5.5.20 and I'm having a problem with the ROW_COUNT () function where it's always returning 0 (zero) would anyone know why?
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