On Tue, Jan 26, 2010 at 10:42 PM, Peter Rabbitson
<rabbit+d...@rabbit.us<rabbit%2bd...@rabbit.us>
> wrote:

> Drew Taylor wrote:
> > I'm not a DBIC expert, but I don't think so. The [...] construct creates
> > an arrayref, so the leading '\' would just create a reference to a
> > reference which is probably NOT what you want. :-) Perhaps you're
> > thinking about passing a scalar ref to put raw SQL into the query, ie.
> > \"some sql"?
>
> This is exactly what you want. Please refer to the fine docs of
> SQL::Abstract.
> In short:
>
> to supply a string of raw sql:
>
> \$sql
>
> to supply a string of raw sql bundled with bind values for placeholders:
>
> \[ $sql, @list_of_bindvals ]
>

Thanks for clearing that up! I've never used the second version, so now I've
learned something new. :-)

Drew
_______________________________________________
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/dbix-class@lists.scsys.co.uk

Reply via email to