Subject | Re: RES: RES: [firebird-support] String Concatenation with null field |
---|---|
Author | Jason Dodson |
Post date | 2006-01-10T14:37:54Z |
A rule of thumb that I always follow... never allow a string field to be null.
Simple. Your alternative is to either coalesce NULLS into something meaningful
to you (most likely '') or in your where clauses have "Where myfield is not null
and myfield <> ''".
Having a field ALLOWED to be NULL is simply a referential shortcut anyway. It
saves you from having a linking table and a join. NULL implies that if you did
use a linking table, it wouldn't join at that field (just like you would get a
null with a left join).
Jason
FabrÃcio Fadel Kammer wrote:
The information transmitted herewith is sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
Simple. Your alternative is to either coalesce NULLS into something meaningful
to you (most likely '') or in your where clauses have "Where myfield is not null
and myfield <> ''".
Having a field ALLOWED to be NULL is simply a referential shortcut anyway. It
saves you from having a linking table and a join. NULL implies that if you did
use a linking table, it wouldn't join at that field (just like you would get a
null with a left join).
Jason
FabrÃcio Fadel Kammer wrote:
> Hi Helen,--
>
> I agree with you, but I've a lot of clients using my software and the
> NULL string field was not important when the software was developed.
> I'll have a lot of work and perhaps problems with validations if I alter
> my database defining all string fields as NOT NULL and the default value
> as a empty string.
>
> If I alter the database I'll need to import the actual database to a new
> and do the validations of null fields.... It'll give me a lot of work!
>
> I stay surprise with this because it doesn't occour in Oracle databases.
>
> Thanks
>
> FabrÃcio F. Kammer
The information transmitted herewith is sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.