Ea has asked for the wisdom of the Perl Monks concerning the following question:
I used dbicdump with components=["InflateColumn::DateTime"] on an Oracle schema which produced a Result class which has
but after searching with dbic and getting a resultset__PACKAGE__->load_components("InflateColumn::DateTime"); ... __PACKAGE__->add_columns( "start_time", { data_type => "datetime", is_nullable => 1, original => { data_type => "date" }, }, );
calling $resultset->start_time would give me DBIx::Class::InflateColumn::DateTime::catch {...} (): Error while inflating '24-APR-18' for start_time on Timetable::Schema::Result::Ical: Invalid date format: 24-APR-18. There are lots of hints in the documentation, but nothing explicit on how to avoid this error.$resultset = $schema->resultset('Ical') ->search({ uid => $id });
I found that the error went away when I added the on_connect_call option to the connect method.
my $schema = Timetable::Schema->connect("dbi:Oracle:$schema_name", $db_username, $db_password, {on_connect_call => 'datetime_setup'} );
Just thought I'd get it down while it was fresh in my mind and I'll update the post when I know more about what I've done.
ta!
Mojoconf was great!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Dbic and inflating Oracle DATE columns - solved
by Ea (Chaplain) on Jan 14, 2019 at 15:23 UTC |