如果查询语句包含',那么正确的语法是什么?

时间:2013-05-25 13:50:34

标签: sqlite

我正在使用SQLite Manager firefox插件执行此查询语句。

查询语句为:

INSERT INTO "main"."bibles" ("scripture","chapter","verse","content")
VALUES("NINGPAWT NINGHPANG"," 22","2 "," Shaloi Karai Kasang gaw, \'Nang tsawra ai, na shadang sha shingtai Isak hpe woi nna Moria ga de sa wa su; ngai nang hpe madun na ra de ai bum hta shi hpe wan nat hkungga di nna nawng e,\" ngu wu ai. ");

SQLite Manager Alert是:

SQLiteManager: Likely SQL syntax error: INSERT INTO "main"."bibles" ("scripture","chapter","verse","content")
  VALUES("NINGPAWT NINGHPANG"," 22","2 "," Shaloi Karai Kasang gaw, \'Nang tsawra ai, na shadang sha shingtai Isak hpe woi nna Moria ga de sa wa su; ngai nang hpe madun na ra de ai bum hta shi hpe wan nat hkungga di nna nawng e,\" ngu wu ai. ");
[ near "ngu": syntax error ]
Exception Name: NS_ERROR_FAILURE
Exception Message: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement]

我的查询语句不正确吗? 什么是正确的陈述?

1 个答案:

答案 0 :(得分:0)

SQLite有不同的引用转义。

不要像'那样逃避\',而要像''

一样

不要像"那样逃避\",而要像""

一样