Declaring exceptions - user-defined exceptions, PL-SQL Programming

Declaring Exceptions

The Exceptions can be declared only in the declarative part of the PL/SQL subprogram, block, or package. By introducing its name, you can declare an exception followed by the keyword EXCEPTION. In the illustration below, you declare an exception named past_due:

DECLARE

past_due EXCEPTION;

The Exception and variable declarations are alike. But keep in mind that, an exception is an error condition, not a data item. Unlike variables, the exceptions cannot appear in the assignment statements or the SQL statements. Though, the same scope rules apply to the variables and exceptions.

Posted Date: 10/5/2012 5:11:13 AM | Location : United States







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

Write discussion on Declaring exceptions - user-defined exceptions
Your posts are moderated
Related Questions
Overriding Default Locking By default, the Oracle locks the data structures for you automatically. Though, you can request exact data locks on rows or tables when it is to you

what is the use of declare keyword

Scoping Within the similar scope, all the declared identifiers should be unique. So, even if their datatypes differ, the variables and parameters cannot share the similar name.

GOTO Statement The GOTO statement branches to a label unconditionally. The label must be exclusive within its scope and should precede an executable statement or a PL/SQL block.

Multiset types - SQL An SQL multiset is what in mathematics is also known as a bag-something like a set except that the same element can appear more than once. The body of an

Delimiters A delimiter is a simple or compound symbol which has a special meaning to PL/SQL. For example, you use delimiters to symbolize an arithmetic operation like additio

Some Varray Examples In SQL Plus, assume that you define an object type Project, as described below: SQL> CREATE TYPE Project AS OBJECT ( 2 project_no NUMBER(2), 3 title VARCHA

Recursive Subprograms The recursive subprogram is the one that calls itself. Think of a recursive call as a call to a few other subprograms that does the similar task as your

Defining Autonomous Transactions To define an autonomous transaction, you use the pragma (compiler directive) AUTONOMOUS_TRANSACTION. The pragma instructs the PL/SQL compiler

DECLARE : This keyword signals the beginning of the declarative section of the PL/SQL block, that contains local declarations. The Items declared locally exist only within the