フリー問題

Oracle Database Program with PL/SQL のフリー問題 4 / 20 問目

問題文

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?

選択肢

  1. 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.
  2. 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.
  3. 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.
  4. 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.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。