Header Ads Widget

Responsive Advertisement

Module 08: Handling Exceptions

Handling Exceptions


01. Which two conditions in a PL/SQL block cause an exception error to occur? (Choose two)

a. Select statement does not return a row.

b. Select statement returns more than one row.

c. Select statement contains a group by clause.

d. Select statement does not have where clause.

e. The data type in the select list are inconsistent with the data types in the INTO clause.

Answer: A, B

02. In which section of a PL/SQL block is a user defined exception waste?

a. Heading.

b. Executable.

c. Declarative.

d. Exception handling.

Answer: D

03. In which section of a PL/SQL block is a user defined exception raised?

a. Heading.

b. Executable.

c. Declarative.

d. Exception handling.

Answer: B

04. Which statement most accurately describes the result of not creating a exception handler for raised exception?

a. The program will continue without raising the exception.

b. There will be a memory leak.

c. Control will pass to the PL/SQL block caller’s exception handler.

d. The program will return a %NOTFOUND error.

Answer: C

05. Which language allows exception handling routines?

a. SQL.

b. PL/SQL.

c. SQL *PLUS.

d. NONE.

Answer: B

06. In which section of a PL/SQL block is an exception named?

a. Header.

b. Exception.

c. Executable.

d. Declarative

Answer: D

07. In which section of a PL/SQL block is a WHEN OTHERS clause allowed?

a. Header.

b. Exception.

c. Executable.

d. Declarative.

Answer: B

08. Which one of the following statements describes a difference between user-defined and pre-defined exceptions?

a. User-defined exceptions enforce database integrity rules, but pre-defined exceptions enforce business rules.

b. User-defined exceptions are explicitly declared, but Oracle’s pre-defined exceptions are not declared.

c. Pre-defined exceptions are trapped during run-time, but user-defined exceptions are trapped during the point of compilation.

d. Oracle’s pre-defined exceptions are explicitly declared, but user-defined exceptions are not declared.

e. User-defined exceptions are declared in the declarative section of a block, but Oracle’s pre-defined exceptions are declared within the executable section of a block.

Answer: B

09. Which predefined Oracle Server exception would you use to handle an error caused by a SQL statement that returns more than one row?

a. VALUE_ERROR.

b. NO_DATE_FOUND.

c. TOO_MANY_ROWS.

d. ACCESS_INTO_NULL.

e. COLLECTION_IS_NULL.

Answer: C

10. In which section of a PL/SQL block would you place a RAISE statement?

a. Header.

b. Exception.

c. Executable.

d. Declarative.

Answer: C

11. Which type of exception requires a RAISE statement?

a. User-defined error.

b. Predefined Oracle Server error.

c. Non-predefined Oracle Server error.

d. None

Answer: A

12. Which predefined Oracle Server exception would you use to handle an error caused by a SQL statement that does not return any rows?

a. VALUE_ERROR.

b. NO_DATE_FOUND.

c. TOO_MANY_ROWS.

d. ACCESS_INTO_NULL.

e. COLLECTION_IS_NULL

Answer: B

Post a Comment

0 Comments