Databasen - NULL dates
ben@bpfh.net
ben at bpfh.net
Wed Oct 18 11:40:39 BST 2006
On Wed, Oct 18, 2006 at 10:51:41AM +0100, Nigel Rantor wrote:
>
>So, have been interviewing DB types lately, looking for a Guru.
>
>We got into a discussion about whether or not to use NULL values for
>dates that are as-yet-unknown. anyone have strong feelings and arguments
>either way?
NULL means 'unknown at present time'. This is a correct use of the NULL
value.
Consider what alternatives you have to represent an unknown date:
* A date in the far future which will never be reached in the lifetime
of the system
* A date in the ludicrously far past
* Don't use the DATE datatype at all, use some string type instead and store
'Unknown' for unknown dates
Anyone think of any other alternatives to using NULL? Anyone want to remotely
try and defend any of the above practices?
Use NULL for what it was designed for.
Ben
More information about the london.pm
mailing list