I have nested cursor loops, and I wanted to catch error 1329, no data fetch, on the outer loop. How can I do this?
I tried to add a second CONTINUE HANDLER for this outer loop cursor but it catches nested loop errors (not wanted), and it ends up not triggering the nested handler.
I have this:
DECLARE cur1 CURSOR FOR select data, valor_split, valor_div from tbl1 where data >= primeira_mov and id_papel = idpapel order by data DESC;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
DECLARE CONTINUE HANDLER FOR 1329 BEGIN
SET nodata_issue = 1;
SET dateof_issue = datasplit;
END;
Any ideas on how can I solve this?
Set a flag to 1 when you enter the inner loop, set it to 0 when you leave it.
Then: