Redeclaring predefined exceptions - user-defined exceptions, PL-SQL Programming

Redeclaring Predefined Exceptions

Keep in mind that, the PL/SQL declares predefined exceptions globally in the package STANDARD; Therefore you need not declare them yourself. Re-declaring the predefined exceptions is error prone as your local declaration overrides the global declaration. For illustration, if you declare an exception named invalid_number and then PL/SQL raises the predefined exception INVALID_NUMBER internally, a handler written for the INVALID_ NUMBER will not catch the internal exception. In such situations, you should use dot notation to specify the predefined exception, which is as shown:

EXCEPTION

WHEN invalid_number OR STANDARD.INVALID_NUMBER THEN

-- handle the error

END;

Posted Date: 10/5/2012 5:15:55 AM | Location : United States







Related Discussions:- Redeclaring predefined exceptions - user-defined exceptions, Assignment Help, Ask Question on Redeclaring predefined exceptions - user-defined exceptions, Get Answer, Expert's Help, Redeclaring predefined exceptions - user-defined exceptions Discussions

Write discussion on Redeclaring predefined exceptions - user-defined exceptions
Your posts are moderated
Related Questions
Records Records are the items of the type RECORD. The Records have exclusively named fields that can store the data values of various types. And hence, a record treat associate

IF Statement The IF statement executes a series of statement conditionally. Whether the series is executed or not depends on the value of the Boolean expression. Syntax:

Parameter Aliasing   To optimize the subprogram call, the PL/SQL compiler can decide between the two techniques of the parameter passing. With the by-value techniques, the v

UNION and OR - SQL SQL supports UNION explicitly but differently from the way it supports JOIN explicitly. As we have seen, JOIN is used exclusively within the FROM clause, su

Mutual Recursion The Subprograms are mutually recursive if they directly or indirectly call each other. In the illustration below, the Boolean functions odd & even, that dete

Passing Cursor Parameters You use the OPEN statement to pass the parameters to a cursor. Unless you want to accept the default values, each proper parameter in the cursor decl

Case Sensitivity Similar to all the identifiers, the variables, the names of constants, and parameters are not case sensitive. For illustration, PL/SQL considers the following n

Rephrase Conditional Control Statements When computing a logical expression, the PL/SQL uses short-circuit evaluation. That is, the PL/SQL stops evaluating the expression as s

Using raise_application_error The Package DBMS_STANDARD that is supplied with Oracle gives language facilities that help your application to interact with Oracle. For illustra

Using DEFAULT You can use the keyword DEFAULT rather than that of the assignment operator to initialize the variables. For e.g. the declaration blood_type CHAR := ’O’; it can b