On Thu, 2009-05-14 at 14:16 +0200, Emmanuel Quevillon wrote:
> I'd like to retrieve the value of a count returned by an SQL query.
>
> acc => $g->name(),
> num => $c->model('Table')->search({'id' => $g->id},<CODE>
>
> where I tried to replace <CODE> with :
>
> 1- )->all()
> 2- { select =>[{'count' => '*'}],as => ['cnt']
> })->next->get_column('cnt')
)->count
http://search.cpan.org/~ribasushi/DBIx-Class-0.08102/lib/DBIx/Class/ResultSet.pm#count_literal
and scroll up a little bit (for some reason the direct link to 'count' is
broken)
_______________________________________________
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]