Note that there are some explanatory texts on larger screens.

plurals
  1. POColumn does not exist Error
    primarykey
    data
    text
    <p>I am working on an application that uses a database with three columns. The following is my create statement: </p> <pre><code>public static final String KEY_ID = "_id"; public static final String KEY_NAME = "name"; public static final String KEY_GAMES = "games"; public static final String KEY_WINS = "wins"; private static final String DATABASE_CREATE = "create table " + DATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_NAME + " text not null, " + KEY_GAMES + " integer, " + KEY_WINS + " integer);"; </code></pre> <p>Now, I am mapping the data in the database to a ListView by doing the following: </p> <pre><code>Cursor notesCursor = mDbHelper.getAllEntriesCursor(); startManagingCursor(notesCursor); String[] from = new String[]{DbAdapter.KEY_NAME, DbAdapter.KEY_WINS, DbAdapter.KEY_GAMES}; int[] to = new int[]{R.id.names, R.id.wins, R.id.games}; SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.win_games, notesCursor, from, to); setListAdapter(notes); </code></pre> <p>When I run, the following error is given to me: </p> <pre><code>java.lang.IllegalArgumentException: column 'wins' does not exist </code></pre> <p>When I shell into the emulator via command line and display the schema of the database, the following is displayed: </p> <pre><code>CREATE TABLE namesTable (_id integer primary key autoincrement, name text not null, games integer, wins integer); </code></pre> <p>So, according to that, it appears that the 'wins' column is there, but I still receive the error. Any idea why this is going on? </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.
    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