Using
https://blogs.oracle.com/oraclemagazine/on-cursors-sql-and-analytics
,
I was able to deal with cx-oracle case of binding list with sql-statement.
I am not sure I am doing the best here though.
Sql-stm:
cursor.execute("Select * from table where table_column in (:column)", {"column":('A','B','C')})
I change the sql query to:
cursor.execute ("with data as (select trim( substr (txt, instr (txt, ',', 1, level ) + 1, instr (txt, ',', 1, level+1) - instr (txt, ',', 1, level) -1 ) ) as token from (select ','||:txt||',' txt from dual) connect by level <= length(:txt)-length(replace(:txt,',',''))+1) Select * from table where table_column in (select * from data) ", {"txt":"A,B,C"})I get the desired result considering I only have 'select' privilege and none other and I cannot execute procedure (or create them).
But what if the list is larger? Say I have more than 1000 elements in the list.
So the string is about 4000+ size and hence I get error "cx_Oracle.DatabaseError: ORA-01460: unimplemented or unreasonable conversion requested"
How can I deal with this case?