A compiler is able to detect only syntax errors. It cannot detect any runtime errors because they do not occur prior to the execution of the program. Furthermore, a runtime error generally occurs only on some occasions, and not the others.
2)
B
An exception-handling section is an optional section of a PL/SQL block. You will recall that only executable section is a required section of a PL/SQL block.
3)
B
4)
B
5)
B, C
Both options are correct. However, you should remember that the value of number 1 is not important. It is number 2 that causes an exception to be raised when its value is equal to zero.
Lab 7.2 Self-Review Answers
A5:
Questions
Answers
Comments
1)
A
You will recall that a built-in exception is raised when a program breaks an Oracle rule. In other words, you do not need to specify how to raise a built-in exception, rather, what actions must be taken when a particular built-in exception is raised. A built-in exception will be raised by Oracle implicitly.
2)
B
3)
B
When a group function is used in the SELECT INTO statement, there is at least one row returned. As a result, exception NO_DATA_FOUND is not raised.
4)
B
Once an exception has been raised in a PL/SQL block, the execution of the block terminates.
5)
B
An exception-handling section may contain multiple exception handlers. For example, NO_DATA_FOUND and OTHERS.