For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > August 2004 > Re: [PHP-DB] odbc_num_rows fails when HAVE_SQL_EXTENDED_FETCH is









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] odbc_num_rows fails when HAVE_SQL_EXTENDED_FETCH is
Robert Twitty

2004-08-26, 3:58 pm

If HAVE_SQL_EXTENDED_FETCH is defined, then the odbc ext will use the
ODBC API function SQLExtendedFetch instead of SQLFetch to retrieve
records. SQLExtendedFetch is only necessary if a forward-only cursor is
not being used. In the case of the odbc ext, it uses a dynamic cursor if
HAVE_SQL_EXTENDED_FETCH is defined. The problem is that dynamic cursors
have the worst performance, while forward-only cursors have the best
performance. However, forward-only cursors do not allow you to
predetermine the number of rows. This is why you are getting -1 from
odbc_num_rows(). A static cursor should have been used instead of a
dynamic cursor. While it is not faster than forward-only, it is faster
than dynamic, and still allows you to get a row count.

-- bob

On Thu, 26 Aug 2004, Mahmut Eren wrote:

> Hi,
> I'm using php-4.3.3 on mandrake Linux. I had a performance problem access=

ing to DB2 databases on As400 systems. When I searched the internet I found=
out that commenting out '#define HAVE_SQL_EXTENDED_FETCH 1' lines from php=
_odbc_includes.h file could solve the problem. I edited the file and recomp=
iled php; the result was a much better performance. But this time odbc_num_=
rows() statement fails and always returns -1. How can I solve this problem?=
Any suggestions?
> Thanks in advance
> Mahmut Eren
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D-
> Bu e-posta ece yukarida isimleri belirtilen kisiler arasinda =F6zel ha=

berlesme amacini tasimaktadir. Size yanlislikla ulasmissa l=FCtfen g=F6nder=
en kisiyi bilgilendiriniz ve mesaji sisteminizden siliniz. Turkiye Cumhuriy=
et Merkez Bankasi A.S. bu mesajin icerigi ile ilgili olarak hicbir hukuksal=
sorumlulugu kabul etmez.
>
> This e-mail communication is intended for the private use of the people n=

amed above. If you received this message in error, please immediately notif=
y the sender and delete it from your system. The Central Bank of The Republ=
ic of Turkey does not accept legal responsibility for the contents of this =
message.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com