I have a parent program and a child program. I want to write
a statement in Exception Block of the parent program so that
when the statement in the exception block is executed, the
control goes to the next statement in the parent block
bypassing the child block.How do i do that?
Answer / Satendera Singh
In Oracle PL/SQL, you can use the 'RETURN' statement within an exception block to exit from the current procedure or function without executing any more code in the current block. To skip the child block and continue with the next statement in the parent block, you should throw an exception inside the exception block and handle it outside the child block.nnHere's a simple example:nnbeginn beginn -- Child Block that might raise an exceptionn exception when others thenn dbms_output.put_line('Exception occurred in child block');n return; -- Exit the procedure without executing any more code in the current blockn end;n -- Parent Block, continues execution after the child block if no exceptions were raised
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a named program unit?
What is the purpose of a cluster?
why should i declare foreign key constraint as self relation instead of binary relation in tables ?
Why use resource manager in Oracle?
What is OCI. What are its uses?
What is BBED in Oracle?
What to do if the binary spfile is wrong for the default instance?
How to use attributes of the implicit cursor in oracle?
What is a Private Synonyms ?
You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?
What is the relation of a user account and a schema in oracle?
What is pragma autonomous transaction in oracle?