0
我有下面的代碼表中的更新值。當我運行代碼時,出現錯誤near "(": syntax error
。更新的SQLite數據庫使用變量
這是我的代碼:
cursor.execute('UPDATE playerList SET (gamesPlayed, totalPTS, totalREB, totalAST, totalSTL, totalTO, totalBLK, ftMade, ftAttempts, fgMade, fgAttempts, threeptMakes, threeptAttempts) = (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) WHERE playerCode = (?)', (newGp, newTotPts, newTotReb, newTotAst, newTotStl, newTotTo, newTotBlk, newFtMade, newFtAttempt, newFgMade, newFgAttempt, newThreePointMade, newThreePointAttempt, code))
我要去哪裏錯了?
您可能想要堅持使用columname = value語法,因爲它可以更容易地查看您是否在某處找到了匹配的錯誤,並且可以格式化爲合理格式(如在一條巨型線中並非全部) – pvg
始終顯示完整的錯誤信息(追溯)問題 – furas
找到SQL教程並檢查'UPDATE'語法 - 對我來說這是不正確的。或者直接在數據庫中運行你的查詢,你應該得到更多的信息。 – furas