On May 3, 8:09pm, Joe For wrote:
> Subject: Testing NotFound in SPL !%#$!!!!
>
> Hi ALL!
>
> I'm working with SPL from few months and all goes fine (<g>), but I still
> have a little doubtful point. The question is: what is the correct way
> to test if a select returns no rows? In 4GL, I can test the Status variable
> for NotFound value (or test Sqlca.Sqlcode), but these variables don't
> exist in SPL (I believe!). I'm workarounding the problem by selecting
> a NOT NULL column and testing if the returned value is null, for example:
> Help!
>-- End of excerpt from Joe For
Try making the select statement into a foreach and use a flag. Eg:
let flag = "N";
foreach select ....
let flag = "Y";
end foreach
if flag = "N" -- no record found!!
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!