問題文
A procedure updates a few thousand rows with one bulk statement over a collection, and a handful of the rows break a constraint. The procedure stops at the first of them and the rest are not attempted. Which change lets the remaining rows be attempted?
選択肢
- Add the clause that lets the bulk statement continue after a failure, and read the attribute that lists the failures once it has finished so that the procedure can report which elements failed.
- Add the clause that limits the number of rows of each batch, so that the failure affects one batch alone and the batches that follow it are attempted after the failing one has been reported.
- Replace the bulk statement with a loop that runs one statement per element, because a statement inside a loop can be wrapped in a block of its own and the handler of that block lets the loop continue.
- Add a handler for the exception inside the loop that builds the collection, and let the handler skip the elements that would break the constraint before the bulk statement is run at all.