There's a common idea amongst database guys that "NULLs are evil", but I
think that's mainly because they can screw up joins and introduce
three-valued logic into queries. For an example, if you have (say) a field
called nullfield that contains a NULL value -
nullfield > 0
will return false. However,
NOT( nullfield > 0 ) will ALSO return false. It's not greater than zero, but
it's not NOT greater than zero either - it's undefined. The only logic
statement about it that will return true, is
nullfield IS NULL
Or if it's a string field -
LEN( nullfield ) > 0
is false, and so is
NOT( LEN( nullfield ) > 0 )
again, only
nullfield IS NULL
will be true.
So you have to remember to explicitly account for NULLs in all of your
queries and join statements. Apart from that, I don't there's anything
inherently 'bad' about nulls, so long as you and anyone who writes queries
on the data remember that they may be there and how to deal with them. In my
view they can occasionally be very useful, for example, determining when a
field has been set to empty, or when it has never been set at all.
Just my 2p worth
Alistair Davidson
Senior Developer
Rocom New Media
www.rocomx.net
"There is no spoon"
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 07 September 2001 16:53
To: CF-Talk
Subject: Need your opinion - PLEASE!
I need to your opinions:
Currently our database allows nulls on all fields besides primary
keys and fields we have specified as wanting a default value. We now
have database support outside of ourselves and their opinion is to
not allow nulls and have a default value of a "blank space". Is there
a reason to populate "blanks" vs. allowing nulls as defaults within
any given table.
My opinion:
If the database has been started with allowing nulls in fields then
why change to defaulting "blank spaces" mid stream and confuse the
developers from today moving forward. I need to know if I'm off
target here.
Your input is greatly valued.
Casey Cook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists