waliwali / ibm-db

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

Exception when use `fetch first N rows only optimize for N rows` #2

Closed GoogleCodeExporter closed 9 years ago

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

In [12]: import ibm_db_dbi as db
In [13]: con = db.connect('DSN=nsi23')
In [14]: cur = con.cursor()
In [15]: cur.execute('select * from sysibm.sysdummy1  fetch first 12 rows
only optimize for 12 rows')
---------------------------------------------------------------------------
ProgrammingError                          Traceback (most recent call last)

c:\python25\lib\site-packages\ibm_db-0.2.5-py2.5-win32.egg\ibm_db_dbi.py in
execute(self, operation, parameters)
   1008         self._prepare_helper(operation)
   1009         self._execute_helper(None, parameters)
-> 1010         return self._set_rowcount(operation, parameters)
   1011
   1012

c:\python25\lib\site-packages\ibm_db-0.2.5-py2.5-win32.egg\ibm_db_dbi.py in
_set_rowcount(self, operation, parameters)
    947                 count_row_tuple = ibm_db.fetch_tuple(stmt_handler)
    948             except Exception, inst:
--> 949                 raise _get_exception(inst)
    950
    951             self.__rowcount = count_row_tuple[0]

ProgrammingError: ibm_db_dbi::ProgrammingError: [IBM][CLI Driver][DB2/NT]
SQL0104N  An unexpected token "optimize" was found following "h first 12
rows only".  Expected tokens may include:  ")".  SQLSTATE=42601\r SQLCODE=-104

What is the expected output? What do you see instead?
pyodbc, ceodbc, mxodbc works fine with this statement

What version of the product are you using? On what operating system?
* ibm_db-0.2.5-py2.5-win32.egg
* Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32 (WinXPsp2)

Original issue reported on code.google.com by D.V.Selitsky@gmail.com on 15 Feb 2008 at 10:32

GoogleCodeExporter commented 9 years ago
Internal defect #154260 opened to track this issue.

Original comment by apiti...@ca.ibm.com on 15 Feb 2008 at 2:51

GoogleCodeExporter commented 9 years ago

Original comment by apiti...@ca.ibm.com on 24 Mar 2008 at 8:56

GoogleCodeExporter commented 9 years ago

Original comment by abhigyan...@in.ibm.com on 28 Apr 2008 at 2:15

GoogleCodeExporter commented 9 years ago

Original comment by abhigyan...@in.ibm.com on 28 Apr 2008 at 3:02

GoogleCodeExporter commented 9 years ago
Fixed in ibm_db-0.2.9.

Original comment by open...@us.ibm.com on 8 May 2008 at 1:44