[PHP-DEV] Re: [PHP3] Count the number of rows with Oracle OCI8 From: Thies C. Arntzen (thies <email protected>)
Date: 11/30/99

On 30 Nov 1999, Manuel Lemos wrote:

> Hello,
>
> How am I supposed to count the number of rows returned by a SELECT query
> using Oracle OCI8 interface. The PHP manual says that OCIRowCount is not
> meant for that.

you're not... sorry

if you need the number of rows you have two options:
- read all rows into memory (until OCIFetch() returns false)
- do a "select count()" for your query in advance and than di the real
select.

oracle (together with some other "major" RDBMs) has no function that will
tell you the size of a result set. speedwise i would accept this behaviour
for unsorted queries, but as soon as you do an "order by" oracle *KNOWS*
the exact number to be returned -> but it doesn't tell you:(

regards,
tc

>
> Regards,
> Manuel Lemos
>
> Web Programming Components using PHP Classes.
> Look at: email protected>?subject=Re:%20[PHP-DEV]%20Re:%20[PHP3]%20Count%20the%20number%20of%20rows%20with%20Oracle%20OCI8&replyto=Pine.LNX.4.20.9911300918320.32267-100000 <email protected>">mlemos <email protected>">http://phpclasses.UpperDesign.com/?user=mlemos <email protected>
> --
> E-mail: mlemos <email protected>
> URL: http://www.mlemos.e-na.net/
> PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
> --
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe <email protected>
> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
>

Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>