Nov-09-2022, 05:00 AM
Goal: Keep content of TableA except items listed on TableB.
I am getting the following error. Code is below. Can you please let me know if you see where problem is when using the "MINUS' syntax?
I am getting the following error. Code is below. Can you please let me know if you see where problem is when using the "MINUS' syntax?
Error:(venv) user@3c0630078aad venv % python delmain2.py
Traceback (most recent call last):
File "/Users/user/venv/delmain2.py", line 61, in <module>
diff("apix.db", "APIX", "APIW")
File "/Users/user/venv/delmain2.py", line 55, in diff
res = connection_obj.execute(statement)
sqlite3.OperationalError: near "SELECT": syntax error
(venv) user@3c0630078aad venv %
import sqlite3 def diff(database, tableA, tableB): #Testing with hardcoded syntax for now connection_obj = sqlite3.connect(database) cursor_obj = connection_obj.cursor() statement = '''SELECT * FROM APIX MINUS SELECT * FROM APIW''' res = connection_obj.execute(statement) return res diff("apix.db", "APIX", "APIW")