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

> 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.

I think you're mixing up something.
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.

If you don't want NULLS in your columns then define them that way and
add triggers for inserting/updating to handle it the way you like (or
supply a default value).

Luc.