You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Joshua Spoerri <jo...@yucs.org> on 2001/11/14 18:09:15 UTC
dbix and raw sql output?
Hello,
How does one do a select count(*) using dbix?
I would just use the underlying dbi,
but it would nice to keep Links and Filters.
Thanks in advance,
Josh
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: dbix and raw sql output?
Posted by Gerald Richter <ri...@ecos.de>.
Hello,
> How does one do a select count(*) using dbix?
$set -> Search ({'$fields' => 'count(*) as cnt'}) ;
$count = $set{'cnt'} ;
You can also use the !Fields instead of '$fields' when you give it at object
setup time
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org