I have a sqlite table. The point is that I want to select all rows where table field "name" is empty. In applying the code gives me error and I cannot fix. The following code:
ArrayList<String> smsContact = new ArrayList<String>();
String nombre2 = "";
baseDatos = openOrCreateDatabase(nombreBD, MODE_WORLD_WRITEABLE, null);
Cursor cur7 = baseDatos.rawQuery("SELECT nombre, telefono FROM memsajessmstotal WHERE nombre='" + nombre2 + "'", null);
if ( cur7.getCount() < 0 || !cur7.moveToFirst() ) return;
smsContact.clear();
do {
String nombre3 = "Desconocido";
String telefono1 = cur7.getString(1);
ContentValues valores = new ContentValues();
valores.put("nombre",nombre3);
//Actualizamos el registro en la base de datos
baseDatos.update(tablaSMS1, valores, "telefono='" + telefono1 + "'", null);
}
while (cur7.moveToNext());
Thanks in advance.