...

View Full Version : Resolved Stored proc, cursor, No data - zero rows fetched, selected, or processed



BubikolRamios
04-19-2011, 09:50 AM
This loops fine, except it newer gets to LOG POINT 2 or LOG POINT 3

LOG POINT 1, does not occur at last record in cursor, which is OK.

proc dies with, error caught in java:
No data - zero rows fetched, selected, or processed

Don't see why is that.




OPEN cur;

FETCH cur INTO c_tmp_str;

WHILE NOT eof DO


SET i_optional_inf = 0 + c_tmp_str;


insert ignore into galery_optional_inf
(
id_galery,
id
)
VALUES
(
i_id_galery,
i_optional_inf
);

FETCH cur INTO c_tmp_str;
//LOG POINT 1
END WHILE;

//LOG POINT 2

CLOSE cur;

//LOG POINT 3

BubikolRamios
04-19-2011, 10:09 AM
ahh , forgot to add:



DECLARE CONTINUE HANDLER FOR NOT FOUND SET eof = 1;

Old Pedant
04-20-2011, 07:26 AM
Yeah, it's a pretty ridiculous syntax, isn't it? You'd think we could simply do something like


DO
SELECT ...;
UNTIL NOT FOUND;

or something along those lines.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum