rcredburn
unread,May 26, 2009, 6:02:49 PM5/26/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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