SQLite - Select and Integer type
I have a problem.
I want to access to an specific register in a SQLite table.
String[] campos = new String[] {"codInterno"};
String[] arg2 = new String[] {strId};
Cursor c = db.query("Incidentes", campos, "codReg=?", arg2, null, null, null);
so I need to have开发者_开发知识库 the register with field codInterno where codReg = strId ... thats no problem.
Now i want to access an specific register, i have to put codInterno - 1, and access using a select where codInterno = codInterno - 1 .. This field is an integer, and always when i have to use a condition, i have to use an String array.
How can i put an integer parameter as condition in a SELECT?
In your arg2 parameter you should use something like
String arg2[] = new { stdId, Integer.toString(codInterno) };
精彩评论