From: [EMAIL PROTECTED]
Operating system: Linux
PHP version: 4.0.4
PHP Bug Type: ODBC related
Bug description: DB2 SQLColumns() doens't work by default.
In ext/php_odbc.c function odbc_columns() has
an incorrect SQLColumns() set of parameters for
DB2 databases.
Currently:
rc = SQLColumns(result->stmt,
cat, SAFE_SQL_NTS(cat),
schema, SAFE_SQL_NTS(schema),
table, SAFE_SQL_NTS(table),
column, SAFE_SQL_NTS(column));
it should be something more along the lines of
rc = SQLColumns(result->stmt,
cat, 0,
schema, strnlen(schema),
table, strnlen(table),
column, strnlen(column));
DB2 Documentation link
http://nscpcw.physics.upenn.edu/db2_docs/db2l0/sqll1311.htm#HDRFNCOLN
Currently it follows the SQLColumns as described by the
MSDN, which says:
"If the SQL_ATTR_METADATA_ID statement attribute is set to SQL_TRUE, ColumnName is
treated as an identifier, and its case is not significant. If it is SQL_FALSE,
ColumnName is a pattern value argument; it is treated literally, and its case is
significant."
By default, DB2 has SQL_ATTR_METADATA_ID set to SQL_FALSE
and doesn't work with the current code. Can we get at least a check and warning
message for SQL_FALSE? I don't know about Oracle.
Workaround: set SQL_ATTR_METADATA_ID to SQL_TRUE
Thanks.
-Szii
[EMAIL PROTECTED]
--
Edit Bug report at: http://bugs.php.net/?id=8811&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]