methew / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Unable to access SQL_XML columns in DB2 #359

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a connection to DB2 via pyodbc
2. Run a SQL select query which selects xml column
 > # define conn_string and query beforehand
 > connection = pyodbc.connect(conn_string)
 > cursor = connection.cursor()
 > cursor.execute(query)

Expected output: run query successfully

Current behavior: cursor.execute() raises exception with following error 
message: "ODBC data type -370 is not supported.  Cannot read column XML_CONTENT"

Versions: pyodbc 3.0.7, OS: SLES 11.2, DB2 10.1, unixODBC 2.2.12

I see only SQL_SS_XML data type in pyodbc upstream code, which is SQL Server 
exclusive. afaik the default SQL data type is SQL_XML. Considering this, it is 
possible that access to XML columns will fail in Postgres as well.

While this issue is not fixed, I'll try to set DB2 to use SQL_SS_XML data type 
instead of SQL_XML using the information in the following URL:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.
db2.luw.apdv.cli.doc%2Fdoc%2Fr0023298.html

Original issue reported on code.google.com by alan.vi...@gmail.com on 25 Feb 2014 at 3:50