title: How to edit the contents of a specific row in Python SQLite3 using ROWID
body: <p>I have the following database (test.db):
  <a href="https://i.stack.imgur.com/yN8dw.jpg" rel="nofollow noreferrer">Test Database</a></p>
  
  <p>As seen in the picture,I created and populated a table ("stuffToPlot"). </p>
  
  <p>I want to edit a specific row (the 5th row for example), and change all the values therein.
  I tried the following code to do this:</p>
  
  <pre><code>import sqlite3
  
  conn = sqlite3.connect('test.db')
  c = conn.cursor()
  
  tableToEdit = 'stuffToPlot'
  rowToEdit = '5'
  unixVar = 5.5
  dateStampVar ='feb-2018'
  keywordVar = 'Hello World'
  valueVar = 25
  
  c.execute("""INSERT INTO """+tableToEdit+""" (unix, datestamp, keyword, value)
  VALUES (?,?,?,?) WHERE ROWID =""" +rowToEdit),(unixVar, dateStampVar, keywordVar, valueVar) 
  
  
  conn.commit()
  
  c.close()
  conn.close()
  </code></pre>
  
  <p>I get the following error when trying to run the code:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "C:\Users\Bob\Documents\Eclipse Workspace\Python Test\SQLite3\SQLite3-3.py", line 19, in 
        VALUES (?,?,?,?) WHERE ROWID =""" +rowToEdit),(unixVar, dateStampVar, keywordVar, valueVar)
    sqlite3.OperationalError: near "WHERE": syntax error</p>
  </blockquote>
  
  <p>I have also tried using the UPDATE/SET method, but get a different error:</p>
  
  <pre><code>c.execute("""UPDATE """+tableToEdit+""" (unix, datestamp, keyword, value)
  SET (?,?,?,?) WHERE ROWID =""" +rowToEdit),(unixVar, dateStampVar, keywordVar, valueVar)
  </code></pre>
  
  <blockquote>
    <p>File "C:\Users\Shaun\Documents\Eclipse Workspace\Python Test\SQLite3\SQLite3-3.py", line 24, in 
        SET (?,?,?,?) WHERE ROWID =""" +rowToEdit),(unixVar, dateStampVar, keywordVar, valueVar)
    sqlite3.OperationalError: near "(": syntax error</p>
  </blockquote>
  
  <p>I just want to edit a specific row (using ROWID) ,any help would be greatly appreciated.</p>