Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Database design dilemma - not null vs nullable

RE: Database design dilemma - not null vs nullable

From: McKown, John <JMckown_at_healthaxis.com>
Date: Fri, 5 Jan 2001 13:17:52 -0600
Message-Id: <10732.125877@fatcity.com>


OK, I'm not a guru or heavy weight by any means. But my reaction is "That stinks". NULL is a useful concept. It means "I don't know.". Why should some "magic value" mean "I don't know"? Now, using a default is OK so long as the default chosen is reasonable. Like defaulting a timestamp to the current date & time for a logging application. Or defaulting a "bonus earned" to 0 for a new employee.

You didn't mention validation but I thought that I'd mention that I prefer that data validation, as much as possible, be encoded in the database system itself. That way, I know that it is consistant. And documented in a single place. With all the validation being done in the application, then you must look at each place that the column can be modified to be sure that the validation is correct. If the valid values are changed, then you must find & update every place in every application where that column can be modified and make sure that the proper checks are in place. You must somehow ensure that a programmer doesn't decide not to do the validation because "it just can't be wrong!"

Just my opinion, for whatever it may be worth to you.



John McKown
HealthAxis

All opinions are my own and are not the opinions of my employer.

> -----Original Message-----
> From: Siv Chelakkara [SMTP:Siv.Chelakkara_at_3cc.co.wayne.mi.us]
> Sent: Friday, January 05, 2001 12:21 PM
> To: Multiple recipients of list ORACLE-L
> Subject: Database design dilemma - not null vs nullable
>
> Hi all,
>
> We have an outside vendor developing an application, which we will
> ultimately inherit for maintenance. They are porting this application
> from a different database platform to Oracle, since we are an Oracle shop.
> They have decided to make every column in every table a NOT NULL column.
> They want to implement default values at the database level for every
> column (' ', 0 and some low date for varchar2, number and date) and then
> let the application validate and enforce significant data as required. I
> am looking for opinions on the pros and cons of this type of approach,
> both from a database and application point of view.
>
> Thanks,
>
> Siv
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Siv Chelakkara
> INET: Siv.Chelakkara_at_3cc.co.wayne.mi.us
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Received on Fri Jan 05 2001 - 13:17:52 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US