Re: Oracle SQLPlus and PHP OCI8 returning different results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gozer <gozer@fusion4.com> wrote:

> As I've discovered, and I should have explained more in my first post, the
> OCIFetchStatement does not work as advertised unless I'm missing something?
> I had hoped to use OCIFetchStatement, however inefficient, to get the number
> of result rows.  I have since switched to OCIFetchInto and I at least get
> the results I expect.  However, I cannot get the number of results found
> without fetching all of them first.  I've seen it stated that using
> OCIRowCount after the first fetch might give you the total results, but it
> does not.  It only gives your current row.  So, I'm now faced with the
> undesirable option of selecting twice or fetching everything, every time.

I don't understand your last sentence. Either you select twice (once
with a "select count(1) from ($YourSelectStatement)", then just with
$YourSelectStatement), or you use OCIFetchStatement() to fetch all of
the results. 

If you use OCIFetchStatement(), you fetch "everything, every time". If
the return value of OCIFetchStatement() is not the number of rows like
advertized, you can still count the array. But regardless of that return
value, you will still have fetched everything - before you could get at
the return value or the array count.

> Am I missing something with the OCIFetchStatement function?  Is it a bug?

I don't know, and I can't test it, because my Oracle is borked at the
moment.

Regards...
		Michael

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux