Results 1 to 2 of 2

Thread: error handler

  1. #1
    Join Date
    Jan 2004
    Posts
    9

    Unanswered: error handler

    i have the following handler:

    DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
    BEGIN
    DECLARE sMsg VARCHAR(8000) DEFAULT '';
    GET DIAGNOSTICS EXCEPTION 1 sMsg = MESSAGE_TEXT;
    SET sPolicyMsgs = sTableNm || ' Failed: ' || sMsg;
    ROLLBACK WORK TO SAVEPOINT policyUOW;
    UPDATE error_tbl ...; COMMIT;
    SET bError = 'Y';
    END;

    on occassion i get an error and when the handler tries to do the rollback the savepoint does not exist. is there a way to check if the savepoint exists? or is there a way to just have the handler go to the next stmt if the rolback throws an error? kind of like on error resume next in vb

    thanks for your time

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    If the savepoint does not exists in some instances, then you have a programming problem that need to be fixed.

    Andy

Posting Permissions

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