On Sat, Jan 15, 2012 at 10:04, Peter Rabbitson wrote:
> What you are experiencing is fallout from API misuse. What you told DBIC
> above is "select me a column (literally) named q!date_part('year', created)!.
> Before DBIC would not do additional processing and your weirdly named
> "column" would be ent to the RDBMS as-is, and things appeared to work.
> Everything would stop instantly if you were to say enable quoting of
> identifiers on your storage.
> 
> What you wanted to do is tell DBIC that the above is a literal SQL chunk
> which must be transported to the RDBMS intact. This is done by supplying
> a reference to the chunk in question:
> 
>     select => [ \"date_part('year', created)" ],

Thank you Peter,

I didn't know I was specifically selecting a column, or that a reference
would pass my string intact. Anyway, it works like a charm!

Regards,
Xavier

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to