Subject | Re: [firebird-support] Force NULL to zero in calculation? |
---|---|
Author | Lucas Franzen |
Post date | 2004-08-17T17:30:23Z |
Joe,
write insert and update triggers that catch NULLS and replace them by 0.
Then you can use your original SQL.
Otherwise you've got to write a StoredProc or use an UDF function, or
write quite complex queries (ie using UNIONS) or ...
(You see: no easy way out of it but the one with triggers)
Luc.
>>You should define columns like that as NOT NULL and / or use triggers toThen go ahead, UPDATE all your columns to 0 where they are NULL and
>>set them to 0 when insering / updating.
>>This will save you a lot of trouble...
>
>
> Yes, good point. Unfortunately, that hasn't happened either.
write insert and update triggers that catch NULLS and replace them by 0.
Then you can use your original SQL.
Otherwise you've got to write a StoredProc or use an UDF function, or
write quite complex queries (ie using UNIONS) or ...
(You see: no easy way out of it but the one with triggers)
Luc.