Subject Re: coalesce and case does not work in firebird 1.5 ??
Author jvpgr
--- In firebird-support@yahoogroups.com, "Antonio Galicia"
<antonio.galicia@...> wrote:
>
> On Fri, Oct 31, 2008 at 3:44 PM, jvpgr <jvpgr@...> wrote:
>
> >> COALESCE WORK_HOURS CASE
> >> ============ ============ ============
> >> 0 <null> 0
> >> 2 2 2
> >> 0 <null> 0
>
> > no, you don't get nothing strange, you get exactly what you should,
> > the problem is that I get only nulls in all fields when the table is
> > empty, to my opinion only the work_hours field should have been null
> > and not the coalesce & case ones too. The other fields value should
> > have been 0
>
> ??
>
> If the table is empty I get no result:
>
> SQL> delete from resource_allocation;
> SQL> commit;
> SQL> select coalesce(work_hours, 0), work_hours,
> CON> case when work_hours is null then 0 else work_hours end
> CON> from resource_allocation;
> SQL>
>
> What is missing?
>
> --
> Saludos,
> PP
> -----------------------------------
> Soy Borracho, no alcohólico
> Los alcohólicos van a reuniones
>

Antonio,

nothing is missing, you are ussing the IBSQL utility and I am ussing
an external debug table to see the results since in my case the select
(see my answer to Helen) is inside a Stored Procedure

Yannis