Subject | Re: empty string=null ? |
---|---|
Author | roskiy |
Post date | 2006-06-26T14:01:38Z |
--- In firebird-support@yahoogroups.com, bill_lam <bill_lam@...> wrote:
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
>converted to
> Some said in old sql standard, zero-length (empty) string will be
> null, eg,In FB1.5
> 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
>
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