Oracle® PL/SQL® Interactive Workbook, Second Edition By Benjamin Rosenzweig, Elena Silvestrova
Table of Contents
Appendix A. Answers to Self-Review Questions
Lab 7.1 Self-Review Answers
A1:
Questions
Answers
Comments
1)
B
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.
A2:
Questions
Answers
Comments
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.
A3:
Questions
Answers
Comments
3)
B
A4:
Questions
Answers
Comments
4)
B
A5:
Questions
Answers
Comments
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
A1:
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.
A2:
Questions
Answers
Comments
2)
B
A3:
Questions
Answers
Comments
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.
A4:
Questions
Answers
Comments
4)
B
Once an exception has been raised in a PL/SQL block, the execution of the block terminates.
A5:
Questions
Answers
Comments
5)
B
An exception-handling section may contain multiple exception handlers. For example, NO_DATA_FOUND and OTHERS.