Thanks to all who answered.  Aagh - now I have 2 opposing answers.  But I
enjoy a debate.  8o)

I don't quite see this point around special checks being required if I make
"no date" equal NULL.

If I choose the NULL route, then I will likely need to say if
(!defined($date)) in my code.
But if I choose the NOT NULL route, then surely I will still need a special
check i.e. if ($date ne '0000-00-00')

To me the latter sounds like a slighly more contrived check, no?



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Ron
> Savage
> Sent: 13 March 2007 23:14
> To: Rose::DB::Object list
> Subject: Re: [RDBO] Beginner q. on date
>
>
> Hi James
>
> > I've searched the documentation without finding anything
> and although
> > there
> > are a couple of threads on this subject it's still not
> clear to me.  In my
> > date fields in MySQL schema, is it best for me to allow
> NULL and then make
> > empty dates map to NULL?  Or is it best to disallow NULL
> and then make
> > empty
> > dates map to 0000-00-00?
>
> In Joe Celko's SQL for Smarties he clearly recommends not (repeat not)
> using NULL, despite that fact that purists insist on using
> it. IMHO there
> are 2 reasons for eschewing it:
> o Conceptual difficulties which arise for many people
> o No need to have special code checks for the value => simpler code
>
> --
> Ron Savage
> [EMAIL PROTECTED]
> http://savage.net.au/index.html
>
> --------------------------------------------------------------
> -----------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the
> chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge
&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to