Subject Re: [firebird-support] Using COALESCE in firebird
Author Helen Borrie
At 02:54 PM 11/02/2005 +1300, you wrote:

>Hi,
>
>can anybody please expalin why I can't use the "COALESCE" function in
>firebird.
>
>I am trying to accomplish the following statement in a stored procedure.
>
>select COALESCE(tbltest.id,0) from tbltest
>where
> tbltest.first_name='doppy'
> and
> tbltest.last_name='draws'
>

In a SP, you need variables to select your output into, e.g.

create procedure blah
as
declare variable returns aValue integer;
begin
select COALESCE(tbltest.id,0) from tbltest
where
tbltest.first_name='doppy'
and
tbltest.last_name='draws'
into :aValue;
...
end

Or perhaps you're not using Firebird 1.5?

./hb