Skip to content
Advertisement

Python Cx_Oracle select query binding a tupled list with WHERE IN clause

Due to Oracle’s 1000 “IN” clause limit, one workaround is to use list tuples. I am attempting this in Python but cant seem to bind the list tuple correctly.

My code:

This gives me error: cx_Oracle.NotSupportedError: Python value of type tuple not supported.

Whats the possible workaround for this error? Thanks

Advertisement

Answer

Your python is generating the following query string…

Then you’re trying to supply a list of tuples as the parameters.


Perhaps instead generate this string, and supply a simple list for the parameters…

For example…

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement