[Catalyst] database access through controller in Catalyst

Gaurav Talwar S3119995 at student.rmit.edu.au
Wed May 9 14:41:32 GMT 2007


Hello all,

i have been trying hard to form a query through my controller to extract records. example:

 my $loan_list = $c->model('MyAppDB::TblLoan') ->search
       (
         {userid => $userid},
         {
           select => [ 'userid', 'loanid', { max => 'price' } ],
           group_by => [qw/ loanid /]
         }
       );

i want to extract a loan list. i have userid. but i want to extract loans only with maximum price. So i am just wondering how should i write the maximum condition in the above situation. right now it does nt seem to work.

Thanks!



More information about the Catalyst mailing list