...

View Full Version : stored func error - cant catch it



BubikolRamios
07-07-2011, 11:04 AM
DECLARE EXIT HANDLER FOR SQLEXCEPTION return -2;

select (max(unique_row_id)+1) into i_max_unique_row_id
from tezaver;

This returns -2

this ofcourse works ok.


select (max(unique_row_id)+1) from tezaver;


if I replace
DECLARE EXIT HANDLER FOR SQLEXCEPTION return -2;
with huge bunch, like:



DECLARE EXIT HANDLER FOR 1000 return 1000;
...
DECLARE EXIT HANDLER FOR 1711 return 1711;


then nothing is detected, but it dies anyway, coz code past
select (max(unique ....
does not get executed.

BubikolRamios
07-07-2011, 11:37 AM
found the bugger:
DECLARE i_max_unique_row_id INT;
-->
DECLARE i_max_unique_row_id BIGINT;


the error was 1264, can tell why it did not pop it out

In any case I read somewhere on net to remove errorhandling from
func completely and catch the thing in app, That's how I got it at the end.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum