Getting the warning 0 row(s) affected, 1 warning(s): And I do not know what it means. Does anybody have an explaination?
1072 Key column 'name' doesn't exist in table
The table/SP is as follows
CREATE TABLE IF NOT EXISTS `sectors`
(
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`sector` VARCHAR(25) NOT NULL ,
--
PRIMARY KEY (`id`) ,
UNIQUE INDEX `sector_idx` USING BTREE (`sector` ASC)
);
DELIMITER $$
CREATE PROCEDURE `AddSector` (IN sector VARCHAR(25),
OUT result BOOLEAN)
MODIFIES SQL DATA
BEGIN
DECLARE CONTINUE HANDLER FOR SQLWARNING, SQLEXCEPTION SET result = FALSE;
SET result = TRUE;
--
INSERT INTO `sectors` (`sector`) VALUES (sector);
COMMIT;
END $$
Change the procedure to:
All stuff inside a stored proc is already run inside an implicit transaction, so the commit is not needed, and may actually be an error (not sure).
DELIMITER ;