Hi,

referring to
> 
http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/Manual/Cookbook.pod#Using_SQL_functions_on_the_left_hand_side_of_a_comparison
I tried to run this query:

$rs->search({
  -and =>
    [
     {"extract(year from age(NOW(),birthday))" => 22},
     {sex => "male"}
    ]
});

The problem is, that quoting is enabled and the docs say that I have to pass the query in the where attribute:
$rs->search({}, { where => \'YEAR(date_of_birth) = 1979' });

But how can I rewrite my query to the other format without writing the raw sql where clause?
Why is it not possible to write my query with as scalar ref:

$rs->search({
  -and =>
    [
     {\"extract(year from age(NOW(),birthday))" => 22},
     {sex => "male"}
    ]
});



greetings,

moritz

_______________________________________________
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