Re: [CDBI] strftime parameters and set_sql

[prev] [thread] [next] [Date index for 2006/02/15]

From: Matt S Trout
Subject: Re: [CDBI] strftime parameters and set_sql
Date: 14:10 on 15 Feb 2006
On Wed, Feb 15, 2006 at 01:35:31PM +0000, Aaron Trevena wrote:
> Hi all,
> 
> I've got a couple of SQL Queries that I want to access through
> Ima::DB/CDBI's set_sql and they contain stuff like :
> 
> STR_TO_DATE(CONCAT_WS(' ',DATE(NOW()),min_time.end_time), '%Y-%m-%d %H:%i:%s'),
> 
> yes, the CONCAT_WS is probably redundant, but I'll worry about that later..
> 
> So.. I can't see anywhere in the documentation or examples for either
> whether I can or whether I should (different things) pass these format
> strings - as they look like they could be confused for set_sql
> placeholders.

That's because transform_sql just uses sprintf, which works the same way
sprintf always does :)

Try s/%/%%/ and you should be fine.

        -- 
             Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] strftime parameters and set_sql
Aaron Trevena 13:35 on 15 Feb 2006

[CDBI] Re: strftime parameters and set_sql
Aaron Trevena 13:59 on 15 Feb 2006

Re: [CDBI] strftime parameters and set_sql
Matt S Trout 14:10 on 15 Feb 2006

Generated at 12:44 on 21 Feb 2006 by mariachi v0.52