DECLARE l_iterator PLS_INTEGER; BEGIN FOR l_iterator IN 1 .. 100 LOOP IF l_iterator = 50 THEN DBMS_OUTPUT.put_line (l_iterator); END IF; END LOOP; END; /So why is there a problem with this quiz? Because another choice was as follows:
DECLARE l_counter PLS_INTEGER := 0; BEGIN FOR l_iterator IN 1 .. 100 LOOP l_counter := l_counter + 1; END LOOP; DBMS_OUTPUT.put_line (l_counter / 2); END; /This block of code avoids declaring l_iterator, and displays "50." Originally (up until more or less the "last minute"), I scored this as correct. Then, as I did my just-before-quiz-starts review of the quiz, I said to myself: "Wait a minute, I could remove that DBMS_OUTPUT.PUT_LINE call and the block would still compile successfully! So this is incorrect." So I changed the way I scored that choice. I think that this change would have made sense if the question did not say "when executed", but that clause clearly indicates that both requirements need to be made at the time the block executes. The lesson I learned (and re-learn, sadly)? Do not change your mind late in the process, certainly not without discussing the change, and motivation for it, with someone else. To conclude: this choice was scored improperly. I will change it from "incorrect" to "correct," and I will also change the explanation to explain clearly why this should be considered correct. And then I will update scores and re-rank. Congratulations to Oliver Dimalanta, one of over a dozen players who reported this mistake. Oliver receives his choice of an O'Reilly Media ebook.