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 accessing 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 recompiled 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 > > ==========================================================- > Bu e-posta sadece yukarida isimleri belirtilen kisiler arasinda özel haberlesme > amacini tasimaktadir. Size yanlislikla ulasmissa lütfen gönderen kisiyi > bilgilendiriniz ve mesaji sisteminizden siliniz. Turkiye Cumhuriyet 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 named above. > If you received this message in error, please immediately notify the sender and > delete it from your system. The Central Bank of The Republic 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 > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php