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
PITS Depressions in secondary cell wall is called pit. A pit present on the free cell wall surface without its partner is called Blind pit. It consists of 2 parts -

Declaring Records Whenever you define a RECORD type, you may declare records of that type, as the illustration shows: DECLARE TYPE StockItem IS RECORD ( item_no INTEG

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

Transaction Control The Oracle is transaction oriented; that is, Oracle uses the transactions to make sure the data integrity. The transaction is a sequence of SQL data manip

Opening a Cursor Opening the cursor executes the query & identifies the result set that consists of all rows that meet the query search criteria. For the cursors declared usin

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.

Variable Declaration - SQL SQL's support for variables is very similar to Tutorial D's, except that the syntax for creating persistent  variables-base tables-is quite differen

Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to the

Example of Tables within a Table - SQL Example: Obtaining C_ER from COURSE and EXAM_MARK SELECT CourseId, CAST (TABLE (SELECT DISTINCT StudentId, Mark FROM EXAM_MARK AS EM

Many of the reports generated from the system calculate the total dollars in a shopper''s purchases. Follow these steps to create a function named TOT_PURCH_SF that accepts a shopp