MySQL Forums
Forum List  »  Stored Procedures

Error 1329 - No data - zero rows fetched, selected, or processed
Posted by: Max Thayer
Date: May 19, 2011 08:20AM

I am running MySQL 5.5, a recent upgrade from 5.1. I have run into an issue with all of my stored procedures throwing a warning on error 1329. My continue handler on NOT FOUND is apparently being ignored.

Following is an example procedure, that until our upgrade, used to work with no issue.

Any advise on the subject would be appreciated.

Thanks in advance.
CREATE TABLE test_table (id INT NOT NULL UNSIGNED AUTO_INCREMENT, `eon_key` VARCHAR(10) NOT NULL) ENGINE=INNODB;

DELIMITER //
DROP PROCEDURE IF EXISTS sp_test//
CREATE PROCEDURE sp_test(IN $id INT, OUT $code INT, OUT $message TEXT)
BEGIN
   DECLARE finished INT UNSIGNED DEFAULT 0;

   DECLARE $eon_key VARCHAR(10);

   DECLARE cur  CURSOR FOR
   SELECT `eon_key` FROM eon_brands;
   DECLARE CONTINUE HANDLER FOR NOT FOUND SET finished = 1;

   DECLARE CONTINUE HANDLER FOR 1062
   BEGIN
       SET $code = 1062;
       SET $message = "Something bad happened";
   END;

   OPEN cur;
   curl:REPEAT
   FETCH cur INTO $eon_key;
   IF NOT finished THEN
       INSERT INTO test_table (id, `key`) VALUES( $id, $eon_key);
   END IF;
   UNTIL finished
   END REPEAT curl;

   CLOSE cur;

   SET $code = 2234;
   SET $message = 'WEEEEEEEEE';
END//
DELIMITER ;



Edited 2 time(s). Last edit at 05/19/2011 11:21AM by Max Thayer.

Options: ReplyQuote


Subject
Views
Written By
Posted
Error 1329 - No data - zero rows fetched, selected, or processed
24510
May 19, 2011 08:20AM


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.