[Dbix-class] Inflating and deflating Oracle dates
Matt S Trout
dbix-class at trout.me.uk
Wed Jun 7 17:58:36 CEST 2006
Dan Horne wrote:
>> From: dbix-class-bounces at lists.rawmode.org [mailto:dbix-class-
>> bounces at lists.rawmode.org] On Behalf Of Hartmaier Alexander
>> Sent: Tuesday, 6 June 2006 8:59 p.m.
>> I created on_connect_do for exactly this purpose.
>> I use Oracle and needed to set the date format because the one in the
>> oracle init file isn't used with perl DBI.
>> I assumed that DBD::Oracle sets it to some DBI standard datetime format...
>> So I set the date format you seem to use too (from you example) and use
>> this one everywhere.
> Hi Alex
> Thanks for your response. I write my app against MySQL, but I periodically
> test it against Oracle to ensure that no db-specific code has crept in.
> What's the best way to deal with on_connect_do without breaking a db-generic
> I've been chipping away at this problem as I get time, and this is what I've
> done so far. Since posting my question I've created a module called
> DateTime::Format::Oracle which implements parse_datetime, parse_date,
> format_datetime and format_date based on the NLS_DATE_FORMAT environment
> variable. Once I've written the tests, I'll ask the DateTime list for
> If this all works, I'll hopefully be able to reference the parser to
> DBIx::Class::Storage::DBI::Oracle so that
> DBIx::Class::InflateColumn::DateTime will work with Oracle too.
Awesome. I look forward to seeing the finished version and patch :)
More information about the Dbix-class