-1
INSERT INTO ta(id,contact_id,street_number,street_name,polygon,pcenter,address,country_id,state_id,city_name,zip,comments,latitude,longitude,geom,
status_code_id,created,modified,creator_id,isSync,company_id) values ('000c5c02-b9a3-11e1-b65f-0025900e9333','404ed266-b9a0-11e1-b65f-0025900e9333',
'694',' Samson','null','null','null','null','null','null','null','null','null','null',
'??????????????????????????3?
D?F@????_tR???????F@????ZtR?X?A??F@??R?WtR?i???F@j?$?\tR?3?
D?F@????_tR?',
'null','1969-12-31 19:00:00','1969-12-31 19:00:00','null','0','null')


07-30 12:18:07.374: W/System.err(17208): android.database.sqlite.SQLiteException: unrecognized token: "'": , while compiling: INSERT INTO ta(id,contact_id,street_number,street_name,polygon,pcenter,address,country_id,state_id,city_name,zip,comments,latitude,longitude,geom,status_code_id,created,modified,creator_id,isSync,company_id) values ('000c5cac-b9a3-11e1-b65f-0025900e9333','404ed2a2-b9a0-11e1-b65f-0025900e9333','704',' Samson','null','null','null','null','null','null','null','null','null','null','��������������������������[!?_??F@?x?atR??V???F@?A?`tR?b?????F@Yg?etR??????F@????ftR?[!?_??F@?x?atR?','null','1969-12-31 19:00:00','1969-12-31 19:00:00','null','0','null')

07-30 12:18:07.374: W/System.err(17208):    at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)

07-30 12:18:07.374: W/System.err(17208):    at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:68)
4

2 回答 2

3

可能是您将字符串值插入到 int 列中。

于 2012-07-30T08:05:57.077 回答
2

您可以尝试使用以下方法将您的输入编码为正确的形式。当您尝试插入的任何值中有一个单引号字符时,就会发生此异常。

DatabaseUtils.sqlEscapeString(String)

于 2012-07-30T08:31:07.180 回答