Re: [PHP3] Count the number of rows with Oracle OCI8
| From: | Thies C. Arntzen | Date: | Tue, 30 Nov 1999 08:22:08 +0000 |
| Subject: | Re: [PHP3] Count the number of rows with Oracle OCI8 | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-13281@lists.php.net to get a copy of this message | ||
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: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
> --
> E-mail: mlemos@acm.org
> 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@lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net
> To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
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