This content has been marked as final. Show 10 replies
i have to create a logic where on success of 1st function..the second should be executed..even if the first function fails..the second should be executed..
But, i dont understand that if your func 1 is independant of func 2, then why to worry.
create or replace package xyz as begin begin -- function_1 exception end; begin -- function_2 exception end; begin -- function_3 exception end; end xyz;
What should happen if func1 fails? Throw some mssg...?
What do you mean by "fail the package"?
A package is merely a collection of procedures, functions, variables, etc. You cannot execute a package. A package cannot succeed. A package cannot fail.
You execute individual methods that happen to be defined within the package. Those individual methods calls can succeed or fail. If you want to call multiple methods from a package, it is no different than if you want to call multiple standalone methods. If you want to handle exceptions, the calling block needs to catch and handle the appropriate exceptions at the appropriate points.
venkat wrote:If a function fails, don't worry. Your package won't get errored out or like you say 'package failure'.
I am not an expert on this ..and haven't tried yet..i was assuming that the first function when failed..will fail the package..let me know thats not the case..
I guess, you are tryin to mean this... if some exception happens, then all LOC below it will not get executed. right?
So only we asked you to put all functions inside a BEGIN - EXCEPTION - END block.
hope that helps.