ibm_db query works but not ibm_db_dbi, 0.7.2

311 views
Skip to first unread message

rcredburn

unread,
May 26, 2009, 6:02:49 PM5/26/09
to ibm_db
Using python 2.6 (UCS2), db2 express c 9.5 fp2, ibm_db 0.7.2. Example
below shows that querying with ibm_db methods works but ibm_db_dbi
throws a CLI option error. Am I doing something wrong or is this a
bug?

$ db2level
DB21085I Instance "db2exp95" uses "32" bits and DB2 code release
"SQL09052"
with level identifier "03030107".
Informational tokens are "DB2 v9.5.0.2", "s080811", "MI00238", and Fix
Pack
"2".
Product is installed at "/opt/ibm/db2/V9.5_expressc".

ibm_db works:

$ python
Python 2.6.2 (r262:71600, May 19 2009, 15:08:13)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print (sys.maxunicode > 2<<15) and 'UCS4' or 'UCS2'
UCS2
>>> import ibm_db
>>> ibm_db.__file__
'/home/user/lib/python2.6/site-packages/ibm_db-0.7.2-py2.6-linux-
i686.egg/ibm_db.so'
>>> dbcon = ibm_db.connect('dmiw', 'user', 'pwd')
>>> stmt = ibm_db.exec_immediate(dbcon, 'select distinct rlse_wafer_pn from dmiw_ibm.testedwaferpass fetch first 10 rows only with ur')
>>> ibm_db.fetch_tuple(stmt)
(u'############',)
...etc...
>>> ibm_db.fetch_tuple(stmt)
False
>>>

ibm_db_dbi does not:

>>> import ibm_db_dbi
/home/user/lib/python2.6/site-packages/ibm_db-0.7.2-py2.6-linux-
i686.egg/ibm_db_dbi.py:25: DeprecationWarning: the sets module is
deprecated
from sets import ImmutableSet
>>> ibm_db_dbi.__file__
'/home/user/lib/python2.6/site-packages/ibm_db-0.7.2-py2.6-linux-
i686.egg/ibm_db_dbi.pyc'
>>> dbicon = ibm_db_dbi.connect('dmiw', 'user', 'pwd')
DEBUG: > ibm_db_dbi > :connect: 'dmiw'
>>> dbicon.server_info()
('DB2/AIX64', '09.01.0007')
>>> cur = dbicon.cursor()
>>> cur.execute('select distinct rlse_wafer_pn from dmiw_ibm.testedwaferpass fetch first 10 rows only with ur')
DEBUG: > ibm_db_dbi > :execute('select distinct rlse_wafer_pn from
dmiw_ibm.testedwaferpass fetch first 10 rows only with ur', None )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/lib/python2.6/site-packages/ibm_db-0.7.2-py2.6-
linux-i686.egg/ibm_db_dbi.py", line 1111, in execute
self._set_cursor_helper()
File "/home/user/lib/python2.6/site-packages/ibm_db-0.7.2-py2.6-
linux-i686.egg/ibm_db_dbi.py", line 987, in _set_cursor_helper
raise _get_exception(inst)
ibm_db_dbi.DatabaseError: ibm_db_dbi::DatabaseError: [IBM][CLI Driver]
CLI0133E Option type out of range. SQLSTATE=HY092 SQLCODE=-99999

abhi

unread,
May 27, 2009, 8:29:58 AM5/27/09
to ibm_db
Hi Robert,
Thanks for sending these details. Those helped great deal in
pinpointing the problem. This is indeed a bug in ibm_db_dbi.py (0.7.2)
which breaks backwards compatibility.
I am providing a temporary fix for the problem, please use
ibm_db_dbi.py kept at http://groups.google.com/group/ibm_db/web/ibm_db_dbi.py
and replace existing ibm_db_dbi.py with this one (at location '/home/
user/lib/python2.6/site-packages/ibm_db-0.7.2-py2.6-linux-i686.egg/')
and delete '/home/user/lib/python2.6/site-packages/ibm_db-0.7.2-py2.6-
linux-i686.egg/ibm_db_dbi.pyc'. Now dbi will work fine.

A defect (no. 185120) is opened for this bug and this will be fixed in
the next release.

-
Abhigyan

rcredburn

unread,
May 27, 2009, 10:30:28 AM5/27/09
to ibm_db
Thanks Abhigyan.
Initial testing shows the fix is working in my environment.

-Robert

On May 27, 8:29 am, abhi <abhigyan_agra...@in.ibm.com> wrote:
> Hi Robert,
>         Thanks for sending these details. Those helped great deal in
> pinpointing the problem. This is indeed a bug in ibm_db_dbi.py (0.7.2)
> which breaks backwards compatibility.
> I am providing a temporary fix for the problem, please use
> ibm_db_dbi.py kept athttp://groups.google.com/group/ibm_db/web/ibm_db_dbi.py

abhi

unread,
May 29, 2009, 10:10:43 AM5/29/09
to ibm_db
The issue is fixed in ibm_db-0.7.2.1

-
Abhigyan
> > > CLI0133E  Option type out of range. SQLSTATE=HY092 SQLCODE=-99999- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages