Database-Oracle [3i Infotech Placement]: Sample Questions 60 - 60 of 132

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 60

Oracle

Question

MCQ▾

Which of the following statement is false

Choices

Choice (4)

a.

Error numbers ranging from 20000 to 20999 are reserved for user defined messages

b.

Oracle checks Uniqueness of User defined errors

c.

Raise_Application_error is used for raising an user defined error.

d.

Any procedure can raise an error, and return an user message and error number

Answer

b.

Explanation

  • The RAISE statement is used to explicitly raise an exception and display an error message, returned by an error code.
  • Used by itself within an exception handler to the calling environment.
  • Stop normal execution of a PL/SQL block or subprogram and transfer control to an exception handler.
  • Raise statements can rise predefine exceptions, or user-define exception.
  • Error number defined between 20,000 to 20,999 (and their associated text) are reserved for user defined message.
  • When ERROR_NUMBER is negative integer the range is -20,000 to -20,999.
  • The RAISE_APPLICATION_ERROR is actually a procedure defined by Oracle it allows the developer to raise an exception and associate an error number and message with the procedure.
  • When we need to raise error from the server and pass this error back to the client process, we use RAISE statement.

Two Reason to Use

  • First is: To replace generic oracle exception messages with more meaningful messages.
  • Second is: To create exception conditions when oracle would not throw them.

Developed by: