RE: [PHP-DB] iodbc + php4
| From: | Andrew Smith | Date: | Fri, 28 Jul 2000 01:38:59 +0000 |
| Subject: | RE: [PHP-DB] iodbc + php4 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1588@lists.php.net to get a copy of this message | ||
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 (not sent to the list), 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