Chapter 11 Exceptions: Advanced Concepts


Lab 11.1 Self-Review Answers

A5:

Questions

Answers

Comments

1)

C

RAISE_APPLICATION_ERROR associates an error number with an error text. Therefore, when working with the RAISE_APPLICATION_ERROR there is no need to create an exception name .

2)

C

RAISE_APPLICTION_ERROR has two required parameters, error_number and error_text. The keep_error is an optional parameter that is usually omitted.

3)

A

Generally, Oracle associates negative numbers with runtime errors. For user -defined exceptions, the range of such numbers is from “20,000 to “20,999.

4)

A

When the RAISE_APPLICATION_ERROR procedure is used, control is always passed to the host environment. For example, if an exception is raised in an inner block, it never propagates to the outer block.

5)

C

 

Lab 11.2 Self-Review Answers

A5:

Questions

Answers

Comments

1)

B

EXCEPTION_INIT pragma is a special instruction to the compiler. It allows handling of unnamed internal exceptions. Such exceptions can also be handled with the help of OTHERS.

2)

B

Because pragma is a special instruction to the compiler, it is processed during compilation time.

3)

C

Some Oracle errors do not have names , and as a result they cannot be referenced in a program. The EXCEPTION_INIT pragma allows you to associate an Oracle error number with a user-defined error.

4)

C

In order to associate an Oracle error with a user-defined exception, the EXCEPTION_INIT pragma requires both error number and name.

5)

C

Error_number is a numeric parameter and should contain any valid Oracle error number; 'ORA' is not a part of an error number.


Lab 11.3 Self-Review Answers

A5:

Questions

Answers

Comments

1)

A

 

2)

A

 

3)

C

 

4)

C

 

5)

B

When no exception is raised, the SQLCODE function returns 0. When there is a NO_DATA_FOUND exception, SQLCODE function returns 100.




Oracle PL[s]SQL by Example
Oracle PL[s]SQL by Example
ISBN: 3642256902
EAN: N/A
Year: 2003
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net