Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,992
    Thanks
    120
    Thanked 76 Times in 76 Posts

    stored func error - cant catch it

    Code:
    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.
    Code:
    select (max(unique_row_id)+1) from tezaver;
    if I replace
    DECLARE EXIT HANDLER FOR SQLEXCEPTION return -2;
    with huge bunch, like:

    Code:
    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.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #2
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,992
    Thanks
    120
    Thanked 76 Times in 76 Posts
    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.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •