Advantages of exceptions, PL-SQL Programming

Advantages of Exceptions

Using the exceptions for the error handling has many benefits. Without an exception handling, every time you issue a command, you should ensure for the execution errors:

BEGIN

SELECT ...

-- check for 'no data found' error

SELECT ...

-- check for 'no data found' error

SELECT ...

-- check for 'no data found' error

The Error processing is not clearly separated from general processing; nor is it robust. If you ignore to code a check, the error goes unobserved and is possible to cause other, apparently unrelated errors. With the exceptions, you can handle errors correctly without the requirement to code the multiple checks, which is as shown:

BEGIN

SELECT ...

SELECT ...

SELECT ...

...

EXCEPTION

WHEN NO_DATA_FOUND THEN -- catches all 'no data found' errors

The Exceptions improve readability by letting you isolate the error-handling routines. The primary algorithm is not covered by error recovery algorithms. The Exceptions also improve reliability. You do not need to worry about checking for an error at every point it might occur. An exception handler is just adding to your PL/SQL block. If the exception is still raised in that block or any sub-block, you can be definite it will be handled.

Posted Date: 10/5/2012 5:04:45 AM | Location : United States







Related Discussions:- Advantages of exceptions, Assignment Help, Ask Question on Advantages of exceptions, Get Answer, Expert's Help, Advantages of exceptions Discussions

Write discussion on Advantages of exceptions
Your posts are moderated
Related Questions
Use the RETURNING Clause Frequently, the application requires information about the row affected by a SQL operation, for illustration, to produce a report or take a subsequent

V ariables and Constants in PL/SQL The PL/SQL permits you to declare constants and variables, and then use them in SQL and procedural statements anywhere in the expression. Th

THEO R Y OF SPECIAL CREATION - Life originated on the earth due to natural events by the super natural power. The biblical story of creation of world within six days was p

Advantages of PL/SQL The PL/SQL is a high-performance transaction processing, completely portable language that offers the following advantages as shown: 1) Support for SQL

Built-In Functions The PL/SQL provides a lot of powerful functions to help you to manipulate the data. These built-in functions fall into the categories as shown below: error r

Forward Declarations The PL/SQL needs that you declare an identifier before using it. And hence, you should declare a subprogram before calling it. For illustration, the decla

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

I want to implement heap sort algorithm in pl sql please share the source code for guidance

Comparison Operators The Comparison operators can compare one expression to another. The outcome is always true, false, or null. Usually, you use a comparison operators in condi

Tautologies: Above given table allows us to read the truth of the connectives in the next manner. Just expect we are looking at row three. It means this says that, if there P