RE: [PHP-DB] iodbc + php4
| From: | Andrew Hill | Date: | Fri, 28 Jul 2000 13:09:24 +0000 |
| Subject: | RE: [PHP-DB] iodbc + php4 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1601@lists.php.net to get a copy of this message | ||
Andrew,
Have you tried odbc_prepare and odbc_execute instead?
Also, what driver are you using, as your logging question would be
determined by that. E.g. if Openlink, start the broker oplrqb +loglevel 7
To be honest though, I don't think this is a driver problem, but something
occurring in the odbc_exec.
Looking at the log files - there are no errors here, which is not what I
would expect. Did you capture this during a failed attempt? The first
looks like a straight connect/disconnect, with perhaps a table name listed,
and the second is a full table description and result via extended fetch.
Best regards,
Andrew
----------------------------------------------------
Andrew Hill
Professional Services Consultant
OpenLink Software
http://www.openlinksw.com
Universal Database Connectivity Technology Providers
-----Original Message-----
From: Andrew Smith [mailto:asmith@cadre.com.au]
Sent: Thursday, July 27, 2000 9:31 PM
To: ahill@openlinksw.com; Php DB
Subject: RE: [PHP-DB] iodbc + php4
Hi Andrew,
Thanks for your help, I've turned on debugging but it doesn't
really show that much more than the error message returned by php. I've
attached two logs, the first is an example of a log generated when I get the
error and the second is one which returns a result set. Their both the same
down to the "SQLAllocStmt" which isn't present in any of the failed
attempts, but I couldn't see anything to help me out with the cause. Is
there a log level I can set? I tried using prepare and execute but the
problem still persists at about the same rate (roughly 10 errors to 1
success)
Any other thoughts?
Andrew
> -----Original Message-----
> Hi Andrew,
>
> You should be able to tell iODBC to trace by:
>
> 1. setting UDBCINI and ODBCINI envrironment variables to the odbc.ini you
> are using.
> 2. putting the following section at the top of your odbc.ini file:
> [UDBC]
> DebugFile=/tmp/debug.out (or whatever filename)
>
> Also, I've been seeing quite a few people with problems using odbc_exec or
> odbc_do with PHP4. Odbc_exec and odbc_do are functions that 'directly
> execute' your SQL statement, meaning that after the connection is
> opened the
> statment is fed in, compiled, a query plan is created, stored in
> temp space,
> and then executed. This is a rather expensive way to perform queries, but
> most people use it because in involves less coding. I would try a
> combination of odbc_prepare and odbc_execute, which will allow
> you to first
> prepare the statement, eg. compile it in the db envrionemnt, and
> then later
> (or immediatley) execute it. The benefit here is that if you set up your
> logic to use groups of similar queries, then you can odbc_prepare a
> statement with a parameter in it, and then pass that parameter in when
> calling odbc_execute. This allows you to call odbc_execute as
> often as you
> want with new parameters, without paying the performance price of
> recompiling, creating an execution plan, and storing the query. Granted
> this may only be a second or less, but it can add up, and it can be longer
> than that if the query is ponderous or the db engine is not optimal.
>
> Hope this helps!
>
> Best regards,
> Andrew
> -----Original Message-----
> Hi All,
> Anyone run into intermittent errors like the following?
>
> Warning: SQL error: [iODBC][Driver Manager]Function sequence error, SQL
> state S1010 in SQLAllocStmt in /home/sites/site6/web/pingodbc.php
> on line 10