wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

ibm_db_dbi: CLI0102E Invalid conversion. SQLSTATE=07006 SQLCODE=-99999 #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.

# -*- coding: UTF-8 -*-
import ibm_db_dbi

conn = ibm_db_dbi.connect('DSN=MYDB')
cur=conn.cursor()

try:
    cur.execute(u'''
        create table nsitemp.kill_me
        (
            dummy varchar(500)
        )
        ''')
except:
    print 'the table is already created'

#produces ibm_db_dbi::ProgrammingError: Statement Execute Failed: [IBM][CLI 
Driver] CLI0102E  Invalid conversion. SQLSTATE=07006 SQLCODE=-99999
cur.execute(u'''
    SELECT 1
    FROM nsitemp.kill_me
    WHERE dummy<>'Индия'
    ''') # <- cyrillic text above, 
         # 'Привет, Индия' works!!

2. Save .py in UTF-8 encoding

3. ibm_db_dbi unexpectedly raises 
   CLI0102E or sometimes SQL0418N

What version of the product are you using? On what operating system?
* Tested on DB2 servers: v8.1, v9.5 / Win32 
* DB2 client: v9.5.401.90 / Win32 (Windows 2003)
  ibm_db-1.0.4-py2.6-win32 / cPython 2.6.6

Original issue reported on code.google.com by D.V.Selitsky@gmail.com on 25 Jul 2011 at 4:04

GoogleCodeExporter commented 9 years ago
I tried to reproduce the above problem but above test case works fine as 
expected.

Please provide the CLI trace, it would help me to figure out the actual problem.

Please refer to following link if you don't know how to take clitrace.
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db
2.luw.admin.trb.doc/doc/c0020795.html

Original comment by rahul.pr...@in.ibm.com on 28 Jul 2011 at 11:28

GoogleCodeExporter commented 9 years ago
Rahul,

CLI trace attached.

Original comment by D.V.Selitsky@gmail.com on 23 Sep 2011 at 2:26

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi Selitsky,
 We are able to reproduce the issue, this is not an ibm_db driver issue but this came through to underline CLI API's. 
 There are one workaround of this problem, while establishing the connection please pass ibm_db.ibm_db.QUOTED_LITERAL_REPLACEMENT_OFF parameter to disable the Literal Replacement Feature of CLI.

eg: ibm_db.connect(database_name, user_name, password, {}, 
ibm_db.QUOTED_LITERAL_REPLACEMENT_OFF)

Note: Turning off Literal Replacement Feature is only available from 1.0.6 
version of ibm_db driver

Thanks,
Rahul

Original comment by rahul.pr...@in.ibm.com on 20 Jul 2012 at 6:10

GoogleCodeExporter commented 9 years ago
From ibm_db-2.0.3, Literal Replacement is OFF by default. And this issue is 
already resolved in underline CLI in DB2v101fp3.

Original comment by rahul.pr...@in.ibm.com on 18 Nov 2013 at 6:17