Subject Re: [ib-support] string concatination, triggers
Author Nando Dessena
Lucas,

> > If I issue
> >
> > select 100 + cast(NULL as integer) from rdb$database
> >
> > I get NULL as a result.
> > Ciao
>
> Which is in fact the correct result since CAST ( NULL AS INTEGER ) will
> result in NULL anyway, and thus 100 + NULL will be NULL, too.

As I see we two agree; I just wanted to know why did Helen say (and
confirm) that 100 + null evaluates to false.

> I think you're mixing up something.

I think you haven't read the thread carefully enough. ;-)

> In Delphi you'll be able to treat a NULL field asInteger which might
> give you a value of 0.
> But this is implemented in the DBTools, the databse knows nothing about
> casting NULL fields as 0 (Integer, Float) or empty string (String).
> It's just NULL.

the cast in my example was just a syntactic aid; I could rewrite it:

select fieldx + 100 as field_sum
from mytable

where mytable has one record only and there fieldx is null.
Ciao
--
____
_/\/ando