Posts tagged: SAVEPOINT

Use SAVEPOINT in a DML loop

Imagine the following situation: You must process a number of records (in a loop or cursor) with the necessary updates / inserts / deletes. But you want that if it goes well that for that record the changes are saved and if it goes wrong for a record that the updates are then reversed. (In short: keep updates that are successful and roll back updates that fail – or possibly give that wrong record an “error status” or notification).

You can find my solution at

Herman Mol is powered by WordPress.  Staypressed theme by Themocracy