SQLite - 选择和整数类型

时间:2011-09-29 15:19:13

标签: android sqlite

我有一个问题。

我想访问SQLite表中的特定寄存器。

String[] campos = new String[] {"codInterno"};
            String[] arg2 = new String[] {strId};

            Cursor c = db.query("Incidentes", campos, "codReg=?", arg2, null, null, null);

所以我需要使用字段codInterno的寄存器,其中codReg = strId ......这没问题。

现在我想访问一个特定的寄存器,我必须放入codInterno - 1,并使用select来访问codInterno = codInterno - 1 ..这个字段是一个整数,总是当我必须使用一个条件时,我必须使用String数组。

如何在SELECT中将整数参数作为条件?

1 个答案:

答案 0 :(得分:0)

在你的arg2参数中你应该使用类似

的东西
String arg2[] = new { stdId, Integer.toString(codInterno) };