I was not trying to update a record. I wanted to copy a row, but change one value in it. In other words, I wanted to insert a new row into my database with all the exact same values of another row, but one, to prevent identical rows.
With UPDATE there are no new rows inserted into the database.
I read the above string from a list and pass it to the below query,
sql = "DELETE FROM docs WHERE pathVariId = '"+myfile+"'"
but I get the error as below
sqlite3.OperationalError: near "D": syntax error
any suggestions to get rid of that '\' which is causing the error, thanks
You could try triple quote the outer double quotes for query. Path name seems Ok, it is only single back slash escaped.
Next time do not hijack old thread but make your own, include link to old thread if necessary.
Thank you, I did try with triple quote and '?' placeholder but the issue was with passing the string as unicode(myfile) instead of str(myfile)
Sorry for posting to the old thread as I came here while searching for the same error message. Thanks a lot for being patient, humble, putting your time and answering silly questions. which is far better than stackexchange ;)