Subject Re: [ib-support] SELECT in stored proc returns wrong value
Author Martijn Tonies
> I would test for an SQLCODE along these lines:
>
> for select last_name
> from employee
> where emp_no = :empno
> into :last_name
> do begin
> suspend;
> when SQLCODE nnnnn do
> exception no_result_set;
>
> end
>
> Unfortunately, no error is raised when the result set is empty. In the
DSQL
> environment this is not a problem as the programming environment is
richer. It
> would make sense to me at least to set an error code if a result set was
empty
> and then allow stored procedures to test for it.

If I remember correctly, Oracle does just that... it raises an exception
saying there's no result set for the 'select into'

It helped me a lot when I was working with Oracle.


--
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."