Closed GoogleCodeExporter closed 9 years ago
I've discovered that, although I can do normal queries, the exception handling
doesn't work, because in the Error class, it is using super(), and since in
Python
2.4 exceptions are classes and not types, it fails. I have come up with a small
patch
for this.
I still get an exception for when I try to perform a SELECT on system tables.
This
might in itself be a separate issue. The following query works if I use
mx.ODBC.DB2.
Also, this is with the patch applied (otherwise it fails in Error.__init__()).
In [4]: c.execute("select tbname,name,coltype,remarks from sysibm.syscolumns s
where
s.dbname='XXXX' and s.tbname='XXXXXXX'")
---------------------------------------------------------------------------
Error Traceback (most recent call last)
<ipython console>
/usr/lib/python2.4/site-packages/ibm_db_dbi.py in execute(self, operation,
parameters)
1181 self.__description = None
1182 self._all_stmt_handlers = []
-> 1183 self._prepare_helper(operation)
1184 self._set_cursor_helper()
1185 self._execute_helper(None, parameters)
/usr/lib/python2.4/site-packages/ibm_db_dbi.py in _prepare_helper(self,
operation,
parameters)
1042 self.stmt_handler = ibm_db.prepare(self.conn_handler, operation)
1043 except Exception, inst:
-> 1044 raise _get_exception(inst)
1045
1046 # Helper for preparing an SQL statement.
Error: ibm_db_dbi::Error: <exceptions.Exception instance at 0x2ba8a83cd200>
Using DB2 v8.1 (sorry)
Original comment by farcep...@gmail.com
on 27 Apr 2010 at 4:07
Attachments:
Scratch that last bit about it not working on system tables. I *do* have an
error in
that query. With mx.ODBC.DB2, I get:
InterfaceError: ('42S22', -206, '[IBM][CLI Driver][DB2] SQL0206N "S.DBNAME" is
not
valid in the context where it is used. SQLSTATE=42703\n', 4612)
So I would amend it to say, ibm_db_dbi's error reporting can be improved
somewhat.
Note that the ibm_db_dbi_p2.4_exc.diff patch is still needed for Python 2.4
compatibility.
Original comment by farcep...@gmail.com
on 27 Apr 2010 at 4:13
We are ready to accept your patch but before that you have to sign contribution
agreement. Please go through http://code.google.com/p/ibm-db/wiki/Contributions
to
understand and sign contribution agreement.
We will not officially support python-2.4 but we will include your patch in our
driver. Though this other users who want to use python-2.4 will get benefit of
your
patch.
Our currently implemented dbi wrapper is able to report error correctly for the
query
you are executing. So, you have to improve you dbi patch to handle error
reporting.
Original comment by rahul.pr...@in.ibm.com
on 7 May 2010 at 6:42
Red Hat Enterprise Linux 5 is an important platform to support, and it ships
Python 2.4. So it's important to have this issue fixed.
Original comment by troels.a...@gmail.com
on 7 Sep 2010 at 7:34
FWIW, I had to abandon my use of Python-2.4 on RHEL-5 for other compatibility
reasons not related to this module. Perhaps this trivial patch will be useful
for someone else, though.
Original comment by farcep...@gmail.com
on 17 Nov 2011 at 4:10
sanity test of ibm_db is working fine, It is still not officially supported.
Original comment by rahul.pr...@in.ibm.com
on 1 Mar 2013 at 10:01
Original issue reported on code.google.com by
farcep...@gmail.com
on 23 Apr 2010 at 3:55Attachments: