Exit/Continue handler for any errors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arun Srinivasan

    #1

    Exit/Continue handler for any errors

    Is there a way to declare exit/continue handler for what ever errors
    that happen in a compound statement?The reason I am asking this is, I
    am doing more than one dcl in the statement, I may get a 'table
    already exists' or 'parent row not found' errors. I just want to log
    them in a table instead of running the SP and piping the output to a
    text log,go through the rigor of reading it. Please help..
  • Serge Rielau

    #2
    Re: Exit/Continue handler for any errors

    Arun Srinivasan wrote:
    Is there a way to declare exit/continue handler for what ever errors
    that happen in a compound statement?The reason I am asking this is, I
    am doing more than one dcl in the statement, I may get a 'table
    already exists' or 'parent row not found' errors. I just want to log
    them in a table instead of running the SP and piping the output to a
    text log,go through the rigor of reading it. Please help..
    There is a build in condition SQLEXCEPTION which catches all errors.
    Now I STRONGLY advise not to use that one for a CONTINUE HANDLER.
    Continue handlers should always be specific.

    Cheers
    Serge
    --
    Serge Rielau
    DB2 Solutions Development
    IBM Toronto Lab

    Comment

    • Arun Srinivasan

      #3
      Re: Exit/Continue handler for any errors

      Thanks Sarge. I understood what you meant!

      Comment

      Working...