IN clause for Oracle Prepared Statement in Python cx_Oracle
<p>I'd like to use the IN clause with a prepared Oracle statement using cx_Oracle in Python.</p>

<p>E.g. query - <code>select name from employee where id in ('101', '102', '103')</code></p>

<p>On python side, I have a list <code>[101, 102, 103]</code> which I converted to a string like this <code>('101', '102', '103')</code> and used the following code in python - </p>

<pre><code>import cx_Oracle
ids = [101, 102, 103]
ALL_IDS = "('{0}')".format("','".join(map(str, ids)))
conn = cx_Oracle.connect('username', 'pass', 'schema')
cursor = conn.cursor()
results = cursor.execute('select name from employee where id in :id_list', id_list=ALL_IDS)
names = [x[0] for x in cursor.description]
rows = results.fetchall()
</code></pre>

<p>This doesn't work. Am I doing something wrong?</p>