How do i update values in an SQL database? SQLite/Python -
i have created table, , have inserted data table. wanted know how update/edit data. example, if have multiple columns in table, of 1 named 'age' , data column = '17', , wanted replace '17' '18', following?
import sqlite3 lite import sys con = lite.connect('records.db') con: cur = con.cursor() cur.execute("insert exampletable(age) values(18) (age = 17)")
to update values in sql database using sqlite library in python, use statement one.
cur.execute("update exampletable set age = 18 age = 17")
for great introduction using sqlite in python, see this tutorial.
Comments
Post a Comment