[egenix-users] egenix zopeda 2.0.2 and execute parameters
aaltepet at bethel.edu
Thu Mar 1 13:24:19 CET 2012
I recently upgraded to egenix mxodbc zopeda 2.0.2. Our zope environment is
zope 2.12.20 and python 2.6.7, 32-bit RHEL 5 (or opensuse 12.1), unixodbc
2.2.12 and oracle instantclient 10.2.0.5 (installed via rpm)
We have some python code which gets an 'eGenix mxODBC Database Connection'
(the zope object), then gets a connection object via get_connection().
With the connection object, we can call the 'execute' method, and pass in
parameters, e.g. to select rows in table `table` where `column` matches 'A':
conn = db.get_connection()
conn.execute('select * from table where column=?', ('A',))
In zopeda 2.2, this always returns an empty rowset.
If I rewrite the query to be:
conn.execute("select * from table where column='A' ")
Then it works.
Another query, like:
conn.execute('insert into table (W,X,Y,Z) values(?,?,?,?)',
raises the following error:
2012-02-28 16:02:36,198 INFO [root] eGenix mxODBC Zope DA:
<Products.mxODBCZopeDA.ZopeDA.DatabaseConnection "DSN=PROD8" thread
-1258087568/-1258087568 at 0xc3d83cc> received an OperationalError
('HY000', 12899, '[unixODBC][Oracle][ODBC][Ora]ORA-12899: value too large
for column "schema"."table"."X" (actual: 4, maximum: 1)\n', 8396); trying
to reconnect and replay transaction
If I revert back to zopeda 2.0.1 the first query, using a params list,
works (and of course the second query works too).
It seems like zopeda2.0.2 isn't passing the parameters down to the odbc
level correctly. The error above seems to indicate that the full params
list is being passed to the first '?' param.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the egenix-users