SQLite插入语句(使用execSql)在Honeycomb或更高版本上不起作用

时间:2011-12-09 19:26:11

标签: android sqlite

我正在使用execSql来处理INSERT语句,并且它在所有pre-Honeycomb版本的Android上都运行正常。在Honeycomb及以后,应用程序就会挂起。它不会返回异常或任何类型的错误。

INSERT语句使用带有3个UNION的复合SELECT语句来提供值。

还有其他人遇到过这个吗?

编辑:似乎只有最终的SELECT语句导致挂起。

insert into RESULTS (Int_ID, SubjID, SubjName, SubjCompID,  SubjCompName, ObjID, ObjName, ObjCompID, ObjCompName,  IntType, MechID, Direction, Effect, Strength, Comment, Sort1, Sort2 )  
SELECT Int_ID, subdc.ID_comp as SubjID,  subdc.Name_comp as SubjName, ID_subject as SubjCompID,  subcompd.Name as SubjCompName, objdc.ID_Compound as ObjID,   objdc.Name_Compound as ObjName, ID_object as ObjCompID, objcompd.Name as ObjCompName,  IntType, MechID, Direction, Effect,Strength,Comment,   (subdc.ID_compound + objdc.ID_Compound)as Sort1, (ID_subject + ID_object)as Sort2  
FROM Int  
INNER JOIN t_Components subdc ON ID_subject = subdc.ID_Component  
INNER JOIN t_Components objdc ON ID_object = objdc.ID_Component  
INNER JOIN Comps subcompd ON ID_subject = subcompd.DrugID  
INNER JOIN Comps objcompd ON ID_object = objcompd.DrugID  
WHERE  subdc.ID_compound <> objdc.ID_Compound

1 个答案:

答案 0 :(得分:0)

只需要在WHERE子句中添加更多语句; 也许这个帖子应该删除?