RE: [PHP-DB] Problem connecting to DB2 via Openlink MT
| From: | Andrew Hill | Date: | Fri, 28 Sep 2001 20:22:51 +0000 |
| Subject: | RE: [PHP-DB] Problem connecting to DB2 via Openlink MT | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12833@lists.php.net to get a copy of this message | ||
Mark,
You would be correct in that assumption.
php_odbc.c assumes you want to set a "Dynamic Cursor", which requires a
primary key.
You can either add a primary key to your table or tell PHP to default to a
"Forward Only" by changing SQL_CURSOR_DYNAMIC in the following section to
SQL_CURSOR_FORWARD_ONLY and recompiling.
#ifdef HAVE_SQL_EXTENDED_FETCH
/* Solid doesn't have ExtendedFetch, if DriverManager is used, get
Info,
whether Driver supports ExtendedFetch */
rc = SQLGetInfo(conn->hdbc, SQL_FETCH_DIRECTION, (void *)
&scrollopts, sizeof(scrollopts), NULL);
if (rc == SQL_SUCCESS) {
if ((result->fetch_abs = (scrollopts &
SQL_FD_FETCH_ABSOLUTE))) {
/* Try to set CURSOR_TYPE to dynamic. Driver will
replace this with other
type if not possible.
*/
if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE,
SQL_CURSOR_DYNAMIC)
== SQL_ERROR) {
odbc_sql_error(conn, result->stmt, "
SQLSetStmtOption");
SQLFreeStmt(result->stmt, SQL_DROP);
efree(result);
RETURN_FALSE;
}
}
} else {
result->fetch_abs = 0;
}
#endif
Hope this helps.
Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software http://www.openlinksw.com
Universal Data Access & Data Integration Technology Providers
> -----Original Message-----
> From: Mark Newnham [mailto:mnewnham@adacorp.com]
> Sent: Friday, September 28, 2001 4:20 PM
> To: 'php-db@lists.php.net'
> Subject: [PHP-DB] Problem connecting to DB2 via Openlink MT
>
>
> DB2 V7.1 / PHP4.0.6 / RH Linux 7.1 / Apache 1.3.20. / --with-iodbc /
> Openlink MT 4.0
>
> When I execute a PHP statement that includes a Join, I get the error
>
> SQL error: [OpenLink][ODBC][Driver]Outer joins on a scrollable cursor
> require a static cursor, SQL state IM928 in SQLExecDirect.
>
> The Statement executes fine in all layers up to PHP, so I assume it's a
> problem in the php_odbc.c.
>
> Can anyone help.
>
>
> TIA
>
> Mark
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>