我有这样的代码:
print "company_id = %d" % company_id
...
db.cursor.execute("insert into person (company_id, first, last, type) values (%d, '%s', '%s', %d);", (company_id, name[0], name[1], type))
我得到以下输出:
company_id = 1
Traceback (most recent call last):
...
File "./GetPeople.py", line 125, in insertPerson
db.cursor.execute("insert into person (company_id, first, last, type) values (%d, '%s', '%s', %d);",
为什么它可以打印出第一行但它给出了db.cursor.execute()
调用错误?