I'm having an issue with my script. The error I'm getting below is
File "./filter.py", line 12
with open('test.txt') as f:
^
SyntaxError: invalid syntax
The code that I'm using below is this.
with open('test.txt') as f:
for row in f:
cur.execute("DELETE FROM filterstagetbl where filtersetidn IN (select filtersetidn from filtersettbl where name = '"+row.strip()+"'")
cur.execute("DELETE FROM filtersetaccesstbl where filtersetidn IN (select filtersetidn from filtersettbl where name = '"+row.strip()+"'")
cur.execute("DELETE FROM filtersetmembertbl where filtersetidn IN (select filtersetidn from filtersettbl where name = '"+row.strip()+"'")
cur.execute("UPDATE filtersettbl set status = 4 where name = '"+row.strip()+"'")
conn.commit()
The script basically connects to DB, looks for a file and delete based on the input of the file.