This is a discussion on unable to catch Exception within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi All, I have a .sql file with declare..begin ..exception(no_data_found and when others).. end; In the above procedure , ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi All, I have a .sql file with declare..begin ..exception(no_data_found and when others).. end; In the above procedure , I am making use(invoke) of one more procedure which is using No_data_found exception and when_others. The problem i am am facing is ,the main procedure is not catching the exception as it is already dealt by the invoking(inside) procedure. I want the exception to be catched by the outside procedure so that i can log those errors into a table. In this case how can we catch the exception again which is already dealth by WHEN_OTHERS in the Inside procedure with out changing the inside(invoked) procedure exception(as it is used by other procedures). -sappi |
| |||
| "sappi" <swapnareddy_09@yahoo.com> a écrit dans le message de news: 1147234411.608664.193910@i40g2000cwc.googlegroups. com... | Hi All, | | I have a .sql file with declare..begin ..exception(no_data_found and | when others).. end; | | In the above procedure , I am making use(invoke) of one more procedure | which is using No_data_found exception and when_others. | | The problem i am am facing is ,the main procedure is not catching the | exception as it is already dealt by the invoking(inside) procedure. | | I want the exception to be catched by the outside procedure so that i | can log those errors into a table. | | In this case how can we catch the exception again which is already | dealth by WHEN_OTHERS in the Inside procedure with out changing the | inside(invoked) procedure exception(as it is used by other procedures). | | -sappi | Have a look at RAISE instruction. Regards Michel Cadot |
| |||
| On 9 May 2006 21:13:31 -0700, "sappi" <swapnareddy_09@yahoo.com> wrote: >Hi All, > >I have a .sql file with declare..begin ..exception(no_data_found and >when others).. end; > >In the above procedure , I am making use(invoke) of one more procedure >which is using No_data_found exception and when_others. > >The problem i am am facing is ,the main procedure is not catching the >exception as it is already dealt by the invoking(inside) procedure. > >I want the exception to be catched by the outside procedure so that i >can log those errors into a table. > >In this case how can we catch the exception again which is already >dealth by WHEN_OTHERS in the Inside procedure with out changing the >inside(invoked) procedure exception(as it is used by other procedures). > >-sappi begin .... begin ... exception when-others then .... raise -- reraise the exception end; exception when-others then -- write into table end; / or (Less ugly) convert the outer exception handler to an (autonomous) procedure and call it everywhere. No need to reraise anymore. -- Sybrand Bakker, Senior Oracle DBA |
| |||
| Have you read the Oracle documentation on this issue? Please look at the PL/SQL User's Guide:S http://download-east.oracle.com/docs...b14261/toc.htm Chapter 10 talks about Exception Handling. Pay particular attention to the section titled "How PL/SQL Exceptions Propagate". After you've read that, look at the next section titled "Reraising a PL/SQL Exception". HTH, Brian -- ================================================== ================= Brian Peasland oracle_dba@nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - Unknown |
| ||||
| sappi wrote: > Hi All, > > I have a .sql file with declare..begin ..exception(no_data_found and > when others).. end; > > In the above procedure , I am making use(invoke) of one more procedure > which is using No_data_found exception and when_others. > > The problem i am am facing is ,the main procedure is not catching the > exception as it is already dealt by the invoking(inside) procedure. > > I want the exception to be catched by the outside procedure so that i > can log those errors into a table. > > In this case how can we catch the exception again which is already > dealth by WHEN_OTHERS in the Inside procedure with out changing the > inside(invoked) procedure exception(as it is used by other procedures). > > -sappi Demos of exception handling in Oracle can be found in Morgan's Library at www.psoug.org. -- Daniel A. Morgan University of Washington damorgan@x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.org |
| Thread Tools | |
| Display Modes | |
|
|