0

尝试执行以下指令时出现错误:SQLError: 'Error #3115: SQL Error.', details:'near 'WHERE': syntax error', operation:'execute', 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();
4

1 回答 1

0

您可能正在寻找INSERT OR REPLACE person ( ... ) VALUES( ... ).

于 2012-04-14T20:36:48.233 回答