Subject Re: empty string=null ?
Author roskiy
--- In firebird-support@yahoogroups.com, bill_lam <bill_lam@...> wrote:
>
> Some said in old sql standard, zero-length (empty) string will be
converted to
> null, eg,
> update foo set bar=''
> will effectively become
> update foo set bar=null
>
> Is this true for FB1.5 and FB2 ?
>
> A related question, in DDL, is
> a varchar(10) default ''
> equivalent to
> bar varchar(10) default null
>
> (For your information MS Access does allow zero-length string)
>
> regards,
> bill
>

In FB1.5
empty string<>null

to avoid unwanted null results
use coalesce function
ex.

select coalesce(field1,''),coalesce(field2,0) from table1

in this scenario fields will be converted to second parameter of
coalesce in case if the field value is null.

read more about this function in firebird documentation