waliwali / ibm-db

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

Timestamp fields disturb parameter binding #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the attached createdb.cmd to generate the test database.
2. Run the attached test.py program to see the error

What is the expected output? What do you see instead?
I expect the example to fetch two rows of output from the database. Instead I 
get the following exception:

Traceback (most recent call last):
  File "\temp\ibm_db-Problem\test.py", line 8, in <module>
    ibm_db.execute(statement, (1, 1))
Exception: Binding Error: [IBM][CLI Driver] CLI0102E  Invalid conversion. 
SQLSTATE=07006 SQLCODE=-99999

What version of the product are you using? On what operating system?
This is Python 2.7.2 on Windows XP using ibm_db 1.0.5.

Please provide any additional information below.
Note that the select statement used in the code has a ? parameter after the 
timestamp condition. That seems to trigger
the binding error.
I think this is the same error as #28426 for the Ruby DB2 bindings. Maybe you 
can get inspiration there: 
http://rubyforge.org/tracker/index.php?func=detail&aid=28426&group_id=2361&atid=
9175

Original issue reported on code.google.com by axel.nie...@web.de on 25 Oct 2011 at 4:13

Attachments:

GoogleCodeExporter commented 9 years ago
By default we enable CLI numeric literal feature, and with this you can't mix 
the parameters markers and inline parameters in prepare statement. 

Mixing the parameter markers and inline parameter in preparing the statement 
will result a unpredictable behavior.

So, Please in preparing the statement always be use parameter marker.

Currently ibm_db python's driver doesn't exposed any option to turned off CLI 
numeric literal feature as in Ruby's driver, in future we will exposed it. 

Original comment by rahul.pr...@in.ibm.com on 14 Nov 2011 at 12:56

GoogleCodeExporter commented 9 years ago
We have exposed the option to turned off CLI numeric literal feature.
For more detail please go to 
http://code.google.com/p/ibm-db/wiki/APIs?ts=1337929456&updated=APIs#ibm_db.conn
ect.

This feature is released with ibm_db-1.0.6

Original comment by rahul.pr...@in.ibm.com on 25 May 2012 at 7:06