I beseech you to right my wrongs!
I am unable retrieve a row using DBIx::Class when specifying the datatype as 'datetime' to use with InflateColumns. The SQL that is generated gives me an error: "You have an error in your SQL syntax;" ... blah blah blah; the key error in the SQL is the datatype hash below:
SELECT me.id, me.token, me.old_invoice, me.date, me.=>, me.{data_type,
+ me.'datetime'} FROM invoices me ...
I am able to save date data flawlessly; I am also able to retrieve data from this field when I remove the datetime datatype from my column declaration. My Class is:
package SEM::Main::Invoices;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/PK::Auto InflateColumn::DateTime C
+ore/);
__PACKAGE__->table('invoices');
__PACKAGE__->add_columns(qw/id
token
old_invoice
date => {data_type => 'datetime'}
/);
__PACKAGE__->set_primary_key('id');
1;
My code retrieving the result set is:
my $rowI = $schema->resultset("Invoices")->search({token=>$sTarget
+})->first;
Any thoughts would be welcome;
TIA to those Monks of the digital cloth.
nybble
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.