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
What is Cursors how to use it in Real time application ?

Write a program to implement the inverted file shown in the slides (Simple Index file, LabelID file and Data file).  Use the Avail_List to point at the deleted Label IDs so that th

PRIMARY KEY: PRIMARY KEY  indicates that the table is subject to a key constraint, in this case declaring that no two rows in the table assigned to ENROLMENT can ever have the

Consider the schema for FreeChecking Bank, that we designed given below. Translate the given ER schema into SQL CREATE TABLE statements (indicating primary key, unique and foreign

Naming Conventions The similar naming conventions apply to all PL/SQL program items and units including the variables, cursors, constants, cursor variables, procedures, exception

Semidifference and NOT - SQL In this section first describe the relational difference operator, named MINUS. Example here shows SQL's closest counterpart of that operator.

Assignment of Variable - Updating a Variable Syntax: SET SN = SID ('S2'); This can obviously be read as "set the variable SN to be equal in value to SID ( 'S2' )".

Subprograms The PL/SQL has two types of subprograms known as the procedures and functions that can take parameters and be invoked. As the following example represents, a subp

Main features of PL/SQL A good way to get familiar with PL/SQL is to look at a sample program. The below program processes an order for tennis rackets. At first, it declares a

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean's wants to create a trigger that automatically updates the stock level of all pr