IN clause for Oracle Prepared Statement in Python cx_Oracle

前端 未结 3 1586
梦谈多话
梦谈多话 2021-01-06 03:13

I\'d like to use the IN clause with a prepared Oracle statement using cx_Oracle in Python.

E.g. query - select name from employee where id in (\'101\', \'102\'

3条回答
  •  遥遥无期
    2021-01-06 03:45

    Since you created the string, you're almost there. This should work:

    results = cursor.execute('select name from employee where id in ' + ALL_IDS)
    

提交回复
热议问题