0

I know this is a repeated question and I've looked at all of them however I cant see what I'm doing wrong.

this is my sqlite3 code:

cursor.execute('''DELETE FROM dates WHERE (Date, Start, End) VALUES( ? , ? , ? );''',
               (fulldaterem, starttimehour2, endtimehour2)) 

and get the error:

sqlite3.OperationalError: near ",": syntax error

where am I going wrong?

1 Answer 1

3

A DELETE statement doesn't take any VALUES section. See the DELETE documentation:

DELETE grammar

You need to build a boolean expression for your WHERE clause:

cursor.execute(
    '''DELETE FROM dates
       WHERE Date=? AND Start=? AND End=?''',
    (fulldaterem, starttimehour2, endtimehour2)) 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.