Re: SPL: How to react to NOTFOUND
Posted in 1997
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 Richard, ON EXCEPTION only captures errors, ie: negative numbers. In SPL the way to recognise a NOTFOUND condition is to use a flag. let notfound_flag = "Y" foreach .... let notfound_flag = "N" end foreach if notfound_flag = "Y" then ..... end if Cheers - Jim -- ---------------------------------------------------------------------- Jim Gordon DHL Airways Inc. jgordon@us.dhl.com ---------------------------------------------------------------------- My opinions are my own. They may vary with time but they remain mine!