我的表有3列(1(ID(2(firstName(3(lastName
我的本地变量具有以下值
id = '1'
firstname = 'xxx'
lastname = 'yyy'
以下查询作品并仅在db
中插入ID的值query.exec_("insert into sportsmen (id) values('%s')" %id)
如何将上述查询扩展到一个go中插入所有3个值(ID,firstName,lastname(?
您必须执行以下命令:
query.exec_("insert into sportsmen (id, firstname, lastname) values('%s', '%s', '%s')" % (id, firstname, lastname))