I have the following Python code extract results to csv from an oracle database.
I have a txt file that contains a list of ID's Example:
ID
ID124543
ID124544
ID124545
I want to read each ID from a file, insert it into a sql query as a variable.
SQL="SELECT ID, FIELD1, FIELD2 FROM SOME_TABLE WHERE ID=variable"
Help me, maybe someone solved this problem. Tell me how to correctly associate variables with a sql query? I am using cx_Oracle.