Talk about "Exception Handling" in PL/SQL?

Questions by Beena   answers by Beena

Showing Answers 1 - 15 of 15 Answers

Exception handing allow developer to raise and handle the error . Each SQL block have it's own exception block. when a error occur than excution immediatly terminates . And control pass to exeption section.

rahultripathi@myway.com 

  Was this answer useful?  Yes

unknown

  • Dec 6th, 2005
 

hi,

the exception are written to handle the exceptions thrown by programs.

we have user defined and system exception.

user defined exception are the exception name given by user (explicitly decalred and used) and they are raised to handle the specific behaviour of program.

system exceptions are raised due to invalid data(you dont have to deaclre these). few examples are when no_data_found, when others etc.

  Was this answer useful?  Yes

Gurpreet Singh

  • Feb 3rd, 2006
 

Hi,

There are 2 types of Exception Handlers:ORACLE defined(Named Exception Handler and Numbered Exception Handler) and User Defined Exceptions.

Named Exceptions : examples- LOGIN_DENIED,TOO_MANY_ROWS etc.

Numbered Exceptions: There are about 20 K numbered exceptions, one can overwrite these numbered exception such that instead of showing a number for the raised exception, user specifed EXCEPTION_NAME will be shown.

User Defined: These are the exceptions defined and raised by user code. This includes Business Rule validations like (Amount < 0) etc.

Regards

Gurpreet Singh

  Was this answer useful?  Yes

jeeva

  • Jun 14th, 2007
 

They are four types of exception

user defiend
user undefined
system defined
system undefined

  Was this answer useful?  Yes

g_sidhu

  • Jan 31st, 2008
 

You can handle exception in two ways:

Trap it with a handler :
 If the exception is raised in the executable section of the block, processing branches to the corresponding exception handler in the exception section of the block. If PL/SQL successfully handles the exception, then the exception does not propagate to the enclosing block or environment. The PL/SQL block terminates successfully.

Propagate it to the calling environment:

If the exception is raised in the executable section of the block and there is no corresponding exception handler, the PL/SQL block terminates with failure and the exception is propagated to the calling environment.

A warning or error condition is called an exception.

An exception may raise in a pl/sql block due to designing faults, coding mistakes or hardware failure. If an exception raises in a block it terminates the process and control transfers to the host environment.

Using Exception handling mechanism we may continue process even in presence of errors.

Exceptions are of two types
1. System or predefined exceptions:- These exceptions are defined globally in STANDARD package. These are implicitly raised by run time environment whenever a statement violates oracle rule or system specified limit.

2. User defined exceptions:- These are specific to that program and raised explicitly using raise statement.


Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions