Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Jeff User
June 20, 2007, 3:26 am
rate this thread
I am kind of new and am trying to set up error handlers in MySql
I create a function. Within, I try to keep selecting until I get
nothing back from select.
I cannot seem to catch the error when the select returns nothing.
I declare a handler like this:
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET tester = 01;
DECLARE EXIT HANDLER FOR SQLWARNING
write out to error log...
Then, I have a loop like this:
select x INTO y
WHERE a = b;
if tester = -1 then
do stuff here....
set b = b + 1;
END LOOP myloop;
The select is guarenteed to retrieve nothing after a few loops around.
but it never ends. The declare continue handler does not fire.
If I run from client command prompt the EXIT handler fires, but I
dont get the warning message, just message thatit exited without a
If I remove all error handlers and run form prompt, it runs endlessly
until I stop it with a counter var. Then I get X number of warnings,
but it doesnt say what the warning is...
What is happening here?
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum