2012-07-30 90 views
-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? 
[email protected][email protected][email protected][email protected]?$?\tR?3? 
[email protected]????_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','��������������������������[[email protected][email protected]?A?`[email protected][email protected]????ftR?[[email protected]?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) 
+0

把你的SQL查詢代碼 – waqaslam 2012-07-30 08:03:35

回答

3

可能要插入一個字符串值,爲int列..

+0

列類型是多邊形。 – user1492610 2012-07-30 08:10:26

+0

可能是錯誤是因爲另一列.. – Nermeen 2012-07-30 08:27:41

+0

如果我留下列的空值,然後我工作正常。 – user1492610 2012-07-30 08:31:28

2

您可以嘗試使用下面的方法來編碼您輸入正確的形式。當您嘗試插入的任何值中有單引號字符時,會發生此異常。

DatabaseUtils.sqlEscapeString(字符串)

相關問題