Here is a new puzzler from Steven Feuerstein:
Which of the following circumstances does not raise a NO_DATA_FOUND exception? (Hint: There is more than one)
- A SELECT INTO statement that finds no rows
- A numeric FOR loop whose low value or high value is NULL
- An attempt to get the value of an element in a collection whose index is not defined
- Reading past the end of a file with UTL_FILE
- Reading past the end of a BFILE with DBMS_LOB
- A SELECT BULK COLLECT INTO statement that finds no rows
- A SELECT COUNT(*) INTO statement that finds no rows
- A SELECT my_function FROM dual, where my_function is a function that raises a NO_DATA_FOUND exception.
I have added 6, 7 and 8 to the list above just to make it a little bit more interesting. I’m not going to tell you the answer, but I will give you the following hints:
Now, the first person who posts the correct answer in the comment section below will get an iPhone…just kidding of course, but he or she will get a big round of applause. You can also send your answers to Puzzler@toadworld.com, you may win a t-shirt.
Filed in Oracle
on 14 Sep 07