当尝试执行以下指令时,我收到错误:SQLError:'错误#3115:SQL错误。',详细信息:'near'WHERE':语法错误',操作:'执行',detailID:'2003' 。有什么想法吗?谢谢!
dbStatement.text = "INSERT INTO person (idPerson,image) VALUES (:idPerson,:image) " +
"WHERE NOT EXISTS (SELECT idPerson FROM person WHERE idPerson=:idPerson)";
dbStatement.parameters[":idPerson"] = person.idPerson;
dbStatement.parameters[":image"] = person.image;
dbStatement.execute();
答案 0 :(得分:0)
您可能正在寻找INSERT OR REPLACE person ( ... ) VALUES( ... )
。