0
採取了SQLite3的速成班後,我試圖讓一個分貝我的第一個項目:OperationalError:近「(」:語法錯誤」在SQLite3的
import sqlite3 as db
conn = db.connect('todo.db')
cursor = conn.cursor()
cursor.execute("CREATE TABLE todo(id serial primary key, title text, created
timestamp default now(), done boolean default 'f')")
cursor.execute("INSERT INTO todo (title) VALUES('Learn web.py')")
不幸的是我收到此錯誤:
OperationalError: near "(": syntax error" at SQLite3
我不明白什麼是錯的代碼。任何人都可以解釋我做錯了嗎?