Hello 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?

I remember a discussion with John where I had a similar problem. I sat a
default of '0000-00-00' and Rose inflates this to undef. But these
fields are 'NOT NULL'.

But nowadays I prefer 'NULL'.

> And then the followup question, if I try to set a date of "" with Rose, this
> doesn't work, naturally.  So is the right thing to do to convert any dates
> of "" to 0000-00-00 or NULL (depending upon the answer to Q1) before doing
> the assignment or can Rose do something more clever?

Right, "" isn't a valid date. You have to use ...

> And final question, how DO you set a field to NULL with Rose, anyway?

... ->method(undef)

Call the column accessor with undef as first argument.


Bye, Uwe


-- 
http://www.perl-uwe.de/ - Tipps und Tricks zu Perl und CPAN-Modulen
http://www.perl-uwe.de/blog/2007-03/datenaustauch-perl-php-mit-php-serialization/
http://www.perl-uwe.de/blog/2007-03/google-webmaster-tools-links-zusammenfassen/
http://www.perl-uwe.de/blog/2007-03/standard-ausgabe-aufzeichnen-mit-io-capture-stdout/

-------------------------------------------------------------------------
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