[Dbix-class] Re: date_time field for oracle

Roger Day c.roger.day at gmail.com
Wed Oct 26 11:12:30 GMT 2011


Solved it - I missed the
__PACKAGE__->load_components(qw/InflateColumn::DateTime/); call ...

cheers
Roger

On Wed, Oct 26, 2011 at 12:00 PM, Roger Day <c.roger.day at gmail.com> wrote:

> Hi
>
> I think I've done all the right things for inserting a date-time into a
> Oracle date field, but I keep getting this:
>
> DBI Exception: DBD::Oracle::st execute failed: ORA-01861: literal does not
> match format string (DBD ERROR: error possibly near <*> indicator at char
> 120 in 'INSERT INTO Events ( application, corps, date_time, letter_code,
> original_file, stream, suppressed) VALUES ( :p1, :p2, :<*>p3, :p4, :p5, :=
p6,
> :p7 ) RETURNING event_id INTO :p8') [for Statement "INSERT INTO Events (
> application, corps, date_time, letter_code, original_file, stream,
> suppressed) VALUES ( ?, ?, ?, ?, ?, ?, ? ) RETURNING event_id INTO ?" with
> ParamValues: :p1=3D'package_mo', :p2=3D'PKZZ', :p3=3D'2011-10-26T11:50:14=
',
> :p4=3D'ABY_CLAPEN_1889', :p5=3D't/datain/ABY_CLAPEN_1889.dat', :p6=3D'pac=
kage_mo',
> :p7=3D'Y', :p8=3Dundef] at
> /usr/opt/perl5/lib64/site_perl/5.8.8/DBIx/Class/Schema.pm line 1078
>
> I do this
>
>  $DBH =3D Dsti::CPP::Schema->connect($dsn,
>                                       $username,
>                                       $password,
>                                       {
>                                           AutoCommit =3D> 1,
>                                           RaiseError =3D> 1,
>                                           on_connect_call =3D>
> 'datetime_setup',
>                                       },
>                                 );
> this
>
> __PACKAGE__->add_columns(qw/event_id
>                             stream
>                             corps
>                             letter_code
>                             original_file
>                             application
>                             suppressed
>                             /,
>                            date_time =3D> {data_type=3D>'datetime'},
> );
>
> and I set up the field in the create statement as DateTime type. Can anyo=
ne
> please point me at what I did to do to get the correct behaviour?
>
> Regards
> Roger Day
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20111026/308=
5a8d0/attachment.htm


More information about the DBIx-Class mailing list