【发布时间】:2017-10-07 15:12:44
【问题描述】:
试图从数据库中的表中取出一条数据并将其插入到另一个表中:
获取订单总额并将其分配给变量:
cursor.execute('''SELECT Price FROM Tracks WHERE TrackID = ?''', (trackChoice,))
ordertotal = str(cursor.fetchall())
放入表中:
cursor.execute('''INSERT INTO Orders(OrderID, Date, OrderTotal, CustomerID, TrackID) VALUES(?, ?, ?, ?, ?)''', (orderID, date,
ordertotal, customerID, trackChoice))
错误:
sqlite3.InterfaceError: Error binding parameter 2 - probably unsupported type.
【问题讨论】:
标签: python sql sqlite sql-insert