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
set serveroutput on declare a number(5); b number(5); c number(5); begin a:=&a; b:=&b; c:=a/b; dbms_output.put_line(c); exception when zero_divide then d

Relational Algebra - SQL It describes some operators, that together constitute an algebra that is not only relationally complete but also irreducibly so (very nearly- apart f

Data Types in SQL - Integer INTEGER or  synonymously INT, for integers within a certain range. SQL additionally has types SMALLINT and BIGINT for certain ranges of integers. T

Semidifference via EXCEPT and JOIN - SQL SELECT * FROM (SELECT StudentId FROM IS_CALLED WHERE Name = 'Devinder' EXCEPT DISTINCT CORRESPONDING SELECT StudentId

Definition of CROSS JOIN - SQL Let s = t1 CROSS JOIN t2, where t1 and t2 are table expressions optionally accompanied by range variables. Then: Note: Here T denotes Table

Creating a SQL file 1. Open a new file in Notepad++ and save it to the location c:\mysql\bin, with the name lab8script.sql (the file extension should be .sql ). Add a MySQL co

Lightweight system to provide and take info from workers in the field and office, have basic design outlined already just require build and implementation Desired Skills CSS,

The Package Body The package specification is implemented by the package body. That is, the package body has the definition of every cursor and the subprogram declared in the p

Keyword &Parameter Description: index_name: This is an undeclared identifier which can be referenced only within the FORALL statement and only as the collection subscript

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.