Dear Sir How to pass Oracle table name as a parameter in a Python query for execution Please see my code Please provide me with an idea on how to pass a table name in a Python query using oracle
conn_str = u'user/password@host:port/service'
conn = cx_Oracle.connect(conn_str)
c = conn.cursor()
string table_name = "abctable"
1.c.execute(u'select your_col_1, your_col_2 from'+table_name)
2.c.execute(u'select your_col_1, your_col_2 from &table_name')
3.c.execute(u'select your_col_1, your_col_2 from :table_name')
'''which one is right for python
for row in c:
print row[0], "-", row[1]
conn.close()
thank you