title: Python Sqlite3 - Using f strings for update database function
body: <p>I have my own personal database I made for fun (so not that concerned with sql injections as its my own private database I made) and am trying to change the functions I created that use string formatting (.format()) and placeholders (?, %s, etc) and use f strings instead. I ran into a problem where one of my functions that updates a specified column into a specified row won't run now that I changed the sqlite3 query to f strings.</p>
  
  <p>This is my current function using f strings:</p>
  
  <pre><code>import sqlite3
  from tabulate import tabulate
  conn = sqlite3.connect("Table.db")
  c = conn.cursor()
  
  def updatedb(Column, Info, IdNum):  
      with conn:
          data = c.execute(f"UPDATE Table_name SET {Column} = {Info} WHERE IdNum={IdNum}")
          c.execute(f"SELECT * FROM Table_name WHERE IdNum = {IdNum}")
      print(tabulate(data, headers="keys", tablefmt="grid", stralign='center', numalign='center'))
  </code></pre>
  
  <p>The function updates the table by updating a specified column of a specified row with the new info you want in that column. For example in a 3 x 3 table, instead of row 1, column 2 being 17, I can use the function to update row 1, column 2 to 18 if that column is an age or something. The select query after that is to just select that particular row that was updated and the print statement after that uses the tabulate package to print out a neat and organized table.</p>
  
  <p>The error I get whenever I try to use this function is:</p>
  
  <pre><code>sqlite3.OperationalError: no such column: Info
  </code></pre>
  
  <p>Whatever I type in for the Info variable in the function is what the error becomes but I can't figure out how to fix the problem.</p>
  
  <p>This is the update statement I had before attempting to change to f strings and it worked fine for me:</p>
  
  <pre><code>data = c.execute("UPDATE Table_name SET {} = ? WHERE IdNum=?".format(Column), (Info, IdNum))
  </code></pre>
  
  <p>It didn't seem like to would be that big of a change to change the above query to a f string but it isn't working so any feedback would be appreciated.</p>