Subject Re: Empty Result Set / NULL handing
Author Adam
--- In firebird-support@yahoogroups.com, "slalom91" <slalom91@...> wrote:
>
> I had a stored procedure similar to the following:
>
> ----
> Select value from table where id = someidnumber into :variable;
>
> If (variable is null) then
> result = 'EOF'
> else
> result = variable;
>
> ----
> In FB 1.5 this was working when the result set was empty. However,
> with FB 2.0.1 it is not.

If it was working in 1.5 you were extremely lucky.

If the result set of your query is empty, the variable will not be set
to null. It won't be set at all.

Before your select, you need to say.

Variable = null;

Or you could simplify the whole thing.

Variable = 'EOF';
Select value from table where id = someidnumber into :variable;


Adam