I found a solution equal to Jonathan's one which is :
my $search = $c-req-param('extactmatch') ? 'search' :
'search_like';
$q = lc($q);
my $rs = $c-model(DB::Dbentry)-$search({
'lower('.$key.')' = $q },
I think you may need to escape an interpolated LHS variable like $key with
DBI::escape() or
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?
BTW,
Interestingly, I thought about the same problem yesterday,
I was looking at the difference of LIKE in postgres and mysql. Seems
like LIKE in postgres is case sensitive and in mysql it's not. So you
have to use ILIKE in postgres to get the same behaviour as LIKE in
mysql.
To make an
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?
BTW, I am using PostGreSQL