mkleehammer / pyodbc

Python ODBC bridge
https://github.com/mkleehammer/pyodbc/wiki
MIT No Attribution
2.92k stars 563 forks source link

Unable to pass limit as parameter for oracledb #1007

Closed Ashwani001 closed 2 years ago

Ashwani001 commented 2 years ago

Please first make sure you have looked at:

Environment

To diagnose, we usually need to know the following, including version numbers. On Windows, be sure to specify 32-bit Python or 64-bit:

Issue

Often it is easiest to describe your issue as "expected behavior" and "observed behavior".

I'm unable to pass limit as a parameter. cursor.execute('select * from students where name=? limit 10','ash') works. But both cursor.execute('select * from students where name=? limit ?,'ash',10) and cursor.execute('select * from students where name=? limit ?',('ash',10)) do not work, what gets executed is 'select * from students where name=NULL limit NULL'. I've tried passing 10 as a string and float to no avail.

v-chojas commented 2 years ago

Could you post an ODBC trace?

This seems like it might be an ODBC driver limitation. It's not unusual for a driver to not support parameterising arbitrary parts of queries.