ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SQL PL - must trap ANY failure of an update statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL PL - must trap ANY failure of an update statement

    I'm writing some of my first SQL PL programs

    One program is running an UPDATE statement (among other things), and I need to guarantee that I capture any errors it throws in an exit handler. I must know for absolute certain if the update worked or not.

    So I used "declare exit handler for sqlexception". Only to find that it does not capture SQLState "02000" record not found.

    That's ok, I can declare an additional handler for 02000

    But my question is, are there any other exceptions that mean the update failed, that are not captured by sqlexception or state 02000? And/or a way of handling any failure guaranteed?

Working...
X