473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Exception and Handler

1
I've trying to make a SP which could catch a SQL error and catch anothers exception, but if I use Exception when I declare the handler it send me an error, the code is:

CREATE PROCEDURE prueba (equery IN NUMBER)
IS
exception1 EXCEPTION;
exception2 EXCEPTION;
PRAGMA EXCEPTION_INIT(exception2,-942);
ecode INTEGER DEFAULT 0;
SQLCODE INTEGER DEFAULT 0;
CONTINUE HANDLER FOR SQLEXCEPTION;
BEGIN

SET (ecode = SQLCODE);

IF SQLCODE <> 0 THEN
RAISE OTHERS;
END IF;
EXCEPTION
WHEN exception1 THEN -- Indica el caso de que se alcance la excepción asignada por el usuario.
DBMS_OUTPUT.PUT_LINE('1ra. excepción de usuario capturara');
WHEN exception2 THEN -- Indica el caso de que se alcance la excepción de sistema.
DBMS_OUTPUT.PUT_LINE('2da. excepción de usuario (Indeterminada) capturada');
WHEN OTHERS THEN
SET (dcode = SYSPROC.SQLERRM (ecode));
DBMS_OUTPUT.PUT_LINE(dcode);
END prueba;



Could anyone helpme please?
Sep 5 '11 #1
0 1374

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Csaba Gabor | last post by:
The usual example shown for trapping for failure of COM instantiation (Windows systems) is something like (see for example http://at2.php.net/manual/en/class.com.php): $word = new...
0
by: Derek Wolf | last post by:
I am having some difficulties implementing an UnHandledException handler for the AppDomain.UnhandledException event in a windows service for unhandled exceptions that occur on a System.Timers.Timer...
2
by: callmebill | last post by:
I'm having a tough time figuring this one out: class MyKBInterrupt( ..... ): print "Are you sure you want to do that?" if __name__ == "__main__": while 1: print "Still here..."
1
by: Nick | last post by:
I am working on a VB.NET application and instead of throwing Try Catch blocks all over the place, I have a custom applcation context which has a exception handler.. Public Class ContextManager...
1
by: | last post by:
I would appreciate some help in understanding the simple C# example relating to handling exceptions. This one relates to catching an error thrown by dividing number by zero. There are a few...
5
by: Ben R. | last post by:
Hi, I've got the following code sample to reproduce my issue: Public Class Form1 Inherits System.Windows.Forms.Form Shared Sub main() Try Application.Run(New Form1)
1
by: JT | last post by:
We have an exception handler which needs some tweaking because when we changed compilers, the embedded assembly didn't work. Ideally, we would like a complete C++ solution, without assembly...
2
by: | last post by:
I would appreciate some help in understanding the simple C# example relating to handling exceptions. This one relates to catching an error thrown by dividing number by zero. There are a few...
1
by: Chris Dunaway | last post by:
I have a Windows forms app which is started from a sub Main. In Sub main I have this line: AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf...
1
by: robtyketto | last post by:
Greetings, I'm a newbie to jsp/java so apologies if this request seems trivial. I have two forms (separate .jsps) which are used to manipulate database records, one adds a record the others...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.