【发布时间】:2016-01-23 01:11:19
【问题描述】:
我的 sql 查询中的第二个占位符出现错误。
photo_number_value = c.execute('INSERT into ebay VALUES (?,?)', photo_number_key,photo_number)
我得到的错误是“意外参数”。
【问题讨论】:
标签: python syntax sqlite arguments
我的 sql 查询中的第二个占位符出现错误。
photo_number_value = c.execute('INSERT into ebay VALUES (?,?)', photo_number_key,photo_number)
我得到的错误是“意外参数”。
【问题讨论】:
标签: python syntax sqlite arguments
语法错误和“意外参数”错误是不同的东西。但是由于execute 只需要两个参数,我会选择后者。您需要将参数值放入列表或元组中才能使其工作:
photo_number_value = c.execute('INSERT into ebay VALUES (?,?)',
(photo_number_key,photo_number))
【讨论】: