Subject | Re: [ib-support] SELECT in stored proc returns wrong value |
---|---|
Author | Martijn Tonies |
Post date | 2001-06-19T21:19:12Z |
> I would test for an SQLCODE along these lines:DSQL
>
> 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
> environment this is not a problem as the programming environment isricher. It
> would make sense to me at least to set an error code if a result set wasempty
> 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."