[Dbix-class] 2-argument SQL agregates

Doran L. Barton fozz at iodynamics.com
Tue Mar 28 18:59:04 CEST 2006


Doran L. Barton wrote:
> Matt S Trout wrote:
>> Doran L. Barton wrote:
>>> I specifically need to use the TO_CHAR() function which takes a field
>>> name and a format string:
>>>
>>> 	SELECT foo, TO_CHAR('bar', 'Month DD YYYYY') FROM Artist
>> { TO_CHAR => [ 'bar', 'Month DD YYYY' ] } ?
>>
>> Always try the obvious thing first (this assumes you have quoting turned on. 
>> if you don't, you probably want \"'Month DD YYYY'")

> Here is the error showing up in the logs now when I try using the above code 
> to include a TO_CHAR(arg1, arg2) in the code:
> 
> 	Cannot mix placeholder styles ":foo" and "?" at 
> /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/DBD/Pg.pm line 188.

Well, I tried quoting the format string like you suggested and... what do 
you know?! IT WORKED!

Quoting? Turn on? Could you point me in the general direction?

-- 
fozz at iodynamics.com is Doran L. Barton, president, Iodynamics LLC
Iodynamics: Linux solutions - Web development - Business connectivity
  "Please do not wash hair or clothes in toilet."
     -- Seen in a Tokyo restroom



More information about the Dbix-class mailing list