Re: SPL: How to react to NOTFOUND
Posted in 1997
In <32EBEDCD.5C4A@ana.med.uni-muenchen.de>, Richard Spitz wrote: }Hi, } }in a Stored Procedure, I have an implicit cursor with FOREACH. However, }it is possible that the SELECT statement returns no rows, and in that }case, }I want to have a completely different action. } }I tried catching the NOTFOUND with ON EXCEPTION IN (100), but it seems }that NOTFOUND doesn't raise an exception at all. Is that correct? How }can }I find out in my procedure whether the SELECT returned a NOTFOUND? } }Regards, Richard }-- }+--------------------------+------------------------------------------+ }| Dr. Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de | }| EDV-Gruppe Anaesthesie | Tel : +49-89-7095-3413 | }| Klinikum Grosshadern | FAX : +49-89-7095-8886 | }| 81366 Munich, Germany | | }+--------------------------+------------------------------------------+ } Richard, Why don't you try the following in your procedure select-statement; if ( dbinfo('sqlca.sqlerrd2') <= 0 ) then raise exception / return-error end if; Felix K. Mathews DHL - Systems Inc.