I am having a .sql file containing all SQL queries. To run them using python script I did something like this :
cursor=cnx.cursor()
for line in open("queries_data.sql").read().split(';\n'):
cursor.execute(line)
Now what I want to do is to store the verbose or results of each query in a log file or for time being simply print them in console.
How it can be done ? Please help.
Is there some argument available in python SQL connector ?
I want this kind of thing with each query :
Query OK, 5 rows affected (0.61 sec)
Records: 5 Duplicates: 0 Warnings: 0