* On Fri, Feb 29 2008, Emmanuel Quevillon wrote:
> Hi,
>
> I'd like to perform a query where I'd like to cal SQL funciton on :
>
> select * from foo where lower(field) = lower(query).
>
> So I wondered if from a ResultSet::search method I could pass
> attribute like 'case => lower' as described in SQL::Abstract::new
> method?

Interestingly, we were discussing this on IRC yesterday and didn't come
up with a good answer.  I ended up doing:

   $rs->search({
       "UPPER(column)" => uc $variable,
   });

This has some problems, including not working with quoting enabled, and
the potential mismatch between UPPER() and uc.  It works for me with
ASCII on SQLite, though, so it's what I'm using :)

Regards,
Jonathan Rockway


_______________________________________________
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