I've noticed that if you set a column type to 'date' or 'datetime' with
oracle a script will error out.  This is because oracle's default response
is in an un-regonized format.  For now I've added the following code to my
init_db function in my base module:
 
sub init_db {
    my $db = My::DB->new;
    my $dbh = $db->dbh or die $db->error;
    $dbh->do(q[alter session set nls_date_format = 'yyyy-mm-dd
hh24:mi:ss']);
    return $db;
}

This will convert all dates returned for the session to a format the
DateTime module can understand.  Is init_db the best place to do this? And
is this something that might make sense to be added to Rose::DB::Oracle
(either by default or maybe an option in the config)?
 
Thanks,
Kevin McGrath
 
-------------------------------------------------------------------------
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