0

I'v searched throughout this forum and couldn't find an answer.

cur.execute("UPDATE lastran SET job_date=newtimedate WHERE job_name=usrjobname")

Why is my code now working?

The two variables are newtimedate and usrjobname

1 Answers1

1

I don't know Python, but it seems you're passing your variables as literals... a little Googling tells me this should be it?

cur.execute("UPDATE lastran SET job_date=? WHERE job_name=?", (newtimedate, usrjobname))

See how this person does it: How to see the real SQL query in Python cursor.execute

justiceorjustus
  • 2,017
  • 1
  • 19
  • 42