I'm very new to SQL, so I'm just getting my bearings with it. I want to delete a row based on an int value, DataID, passed in by some other method. Here is the code:
query = ("""DELETE FROM TradeSupportPortal.dbo.ExchangeDropCopyIgnore
WHERE TradeSupportPortal..ExchangeDropCopyIgnore.DropCopyID = '{}'""")
query.format(dataID)
cnxn = pyodbc.connect(self.__connection_string)
cursor = cnxn.cursor()
cursor.execute(query)
cnxn.commit()
However, I get an error message saying "Conversion failed when converting the varchar value '{}' to data type int." I'm not sure why, because dataID is an int. Any help would be appreciated! Thanks!