0

次の手順を実行しようとすると、エラーが発生します:SQLError:'エラー#3115:SQLエラー。'、詳細:'near' WHERE':構文エラー'、操作:'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 に答える