Note that there are some explanatory texts on larger screens.

plurals
  1. POsqlite returned: error code = 1, msg = no such column: Bateria
    primarykey
    data
    text
    <p>I get an error every time when i run the application that</p> <blockquote> <p>sqlite returned: error code = 1, msg = no such column: Bateria</p> </blockquote> <h2>Database code</h2> <pre><code> public AdminSQLiteOpenHelper(Context context, String nombre, CursorFactory factory, int version) { super(context, nombre, factory, version); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("create table gas(_id integer primary key autoincrement, " + "estacion text not null, precio intenger not null, fecomgas text not null)"); db.execSQL("create table aceite(_id integer primary key autoincrement, " + "marcef text not null, precio intenger not null, fecamac text not null)"); db.execSQL("create table repuestos(_id integer primary key autoincrement, tipo text not null, precio intenger not null, fecomrep text not null)"); } @Override public void onUpgrade(SQLiteDatabase db, int versionAnte, int versionNue) { db.execSQL("drop table if exists gas"); db.execSQL("create table gas(_id integer primary key autoincrement, " + "estacion text not null, precio intenger not null, fecomgas text not null)"); db.execSQL("drop table if exists aceite"); db.execSQL("create table aceite(_id integer primary key autoincrement, " + "marcef text not null, precio intenger not null, fecamac text not null)"); db.execSQL("drop table if exists repuestos"); db.execSQL("create table repuestos(_id integer primary key autoincrement, tipo text not null, precio intenger not null, fecomrep text not null)"); } } </code></pre> <p>The error occurs everytime i call this method</p> <pre><code>public void consulta(View v) { AdminSQLiteOpenHelper admin = new AdminSQLiteOpenHelper(this, "mimoto", null, 1); SQLiteDatabase bd = admin.getWritableDatabase(); String tipor = tiporep.getText().toString(); //String[] repu = new String[] {tipor}; Cursor filas = bd.rawQuery("select tipo,precio,fecomrep from repuestos where tipo=" + tipor + "", null); if (filas.moveToLast()) { tv01.setText(filas.getString(0)); tv02.setText(filas.getString(1)); tv03.setText(filas.getString(2)); } else //Toast.makeText(this, "No existe una persona con dicho dni" + tv3, // Toast.LENGTH_SHORT).show(); bd.close(); // Fin ultimo tanqueo } </code></pre> <p>Bateria is from String tipor, an editext</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload