这是我得到的错误:
跟踪(最近通话最近):文件“ / Users / My 文档/独立学习/ BBA编码相关工作/创建 带有SQLite3 for Python / MarketCo1.py的数据库”,第89行,在 '''); sqlite3.OperationalError:输入不完整
下面是我使用的代码:
cursor.execute('''CREATE TABLE ContactEmployee(
ContactEmployeeID INTEGER PRIMARY KEY,
ContactID INTEGER, EmployeeID INTEGER,
ContactDate NUMERIC,
Description TEXT,
FOREIGN KEY(ContactID) REFERENCES Contact(ContactID),
FOREIGN KEY(EmployeeID) REFERENCES Employee(EmployeeID)
''')
db.commit()
答案 0 :(得分:0)
正如glibdud在评论中提到的那样,您缺少右括号:
cursor.execute('''CREATE TABLE ContactEmployee(
ContactEmployeeID INTEGER PRIMARY KEY,
ContactID INTEGER, EmployeeID INTEGER,
ContactDate NUMERIC,
Description TEXT,
FOREIGN KEY(ContactID) REFERENCES Contact(ContactID),
FOREIGN KEY(EmployeeID) REFERENCES Employee(EmployeeID))
''')
db.commit()