【发布时间】:2016-01-01 01:29:25
【问题描述】:
我写了一个方法如下:
def add(self,table_name, tc_no, file_no):
self._cursor.execute("select HastaId from {}".format(table_name)," where TC=%s and FileNo=%s",(tc_no,file_no))
row = self._cursor.fetchone()
return row
我得到了一个错误
TypeError: execute() 最多接受 2 个位置参数(给定 3 个)
我知道format() 中的错误。我该如何使用它?
【问题讨论】: