API 10,安卓 2.3.3
我有代码
Cursor c = myDataBase.rawQuery("select * from linhas as l where exists"+
"(select * from linhas_ruas_ida as l1, linhas_ruas_ida as l2,ruas as r1,ruas as r2 where l1.id_linha = l2.id_linha and l1.id_rua = r1._id and l2.id_rua = r2._id and r1.nome = '"+rua1+"' and r2.nome = \""+rua2+"\" and l.codigo = l1.id_linha and l1.posicao <= l2.posicao)"+
"or exists (select * from linhas_ruas_volta as l1, linhas_ruas_volta as l2,ruas as r1,ruas as r2 where l1.id_linha = l2.id_linha and l1.id_rua = r1._id and l2.id_rua = r2._id and r1.nome = \""+rua1+"\" and r2.nome = \""+rua2+"\" and l.codigo = l1.id_linha and l1.posicao <= l2.posicao)"+
"or exists (select * from linhas_ruas_ida as l1, linhas_ruas_volta as l2,ruas as r1,ruas as r2 where l1.id_linha = l2.id_linha and l1.id_rua = r1._id and l2.id_rua = r2._id and r1.nome = \""+rua1+"\" and r2.nome = \""+rua2+"\" and l.codigo = l1.id_linha)",null);
c.moveToFirst();
因此,我的应用程序在 c.moveToFirst(); 行冻结。[我可以在调试模式下看到]
例如,如果我更改 SQL
("select * from linhas as l where 1")
工作正常!!!
附言
private SQLiteDatabase myDataBase;