Whats the oracle equivalent for finally used in C# [message #167596] |
Fri, 14 April 2006 06:25  |
captainjacksparro
Messages: 6 Registered: April 2006
|
Junior Member |
|
|
Hi
can anybody tell whats the oracle equivalent for Finally statement used in C#.NET
try/catch/finally.
I have used custom exception in Oracle stored procedure and there is some code that is common to all the exceptions. So i want to use finally statement.
Thanks
Sonu
|
|
|
|
Re: Whats the oracle equivalent for finally used in C# [message #167665 is a reply to message #167596] |
Sat, 15 April 2006 02:24   |
captainjacksparro
Messages: 6 Registered: April 2006
|
Junior Member |
|
|
Well "when others" is used for exception , i am talking of some other statement like finally which is always executed.
I have used soo many exception
Exception
WHEN EXCEPTION1 then do something
WHEN EXCEPTION2 then do something
WHEN EXCEPTION3 then do something
now after all the exceptions i want Oracle equivalent for finally (in C#.NET or C++ or java), there is some code that is common to all the exception , so i want to use something like finally.
|
|
|
Re: Whats the oracle equivalent for finally used in C# [message #167709 is a reply to message #167665] |
Sat, 15 April 2006 10:18   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
As far as I know there is no such thing. To achieve the same result, you could nest your blocks.
begin
begin
do_this;
exception
when e_error1
then
do_err1;
when others
then
do_oth;
end;
do_your_finally;
end;
do_your_finally will be executed regardless of any error (if any).
Is this what you are looking for?
[Edit: added more explanation]
[Updated on: Sat, 15 April 2006 10:20] Report message to a moderator
|
|
|
|