I have query in .txt file and i am trying to run that query using python. it is working fine if my query written in single line. but my query had multiple lines in text file. it is giving syntax error as it is reading only first line.
i have tried below code
cursor = cnxn.cursor()
with open('C:\Python_Script_Test\INSERTS.txt','r') as inserts:
for statement in inserts:
cursor.execute(statement)
i have big query with multiple lines in it. can you please suggest the best code to read all the lines to run query.