Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ul> <li><p>I think you are calling <code>populateFields();</code> to access the column but table is not created yet, that's why you are getting <strong>"column 'website_1' does not exist"</strong> exception.</p></li> <li><p>I would strongly recommended you to have a look at <a href="http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html" rel="nofollow noreferrer">SQLiteOpenHelper</a> Class to manage your database. It will internally handle when to create the database's schema or when to upgrade it. </p></li> </ul> <p>Here is a sample example which will give you some idea about how to upgrade your database or execute alter query.</p> <pre><code>public class OpenHelper extends SQLiteOpenHelper { private final static int DB_VERSION = 2; public TracksDB(Context context) { super(context, DB_NAME, null, DB_VERSION); } @Override public void onCreate(SQLiteDatabase db) { final String CREATE_TBL = "create table " + ANIMALS_TABLE + " (_id integer primary key autoincrement, " + "animal_name text not null, " + "biography text not null);"; db.execSQL(CREATE_TBL); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { if (oldVersion &lt; 2) { final String ALTER_TBL = "ALTER TABLE " + ANIMALS_TABLE + " ADD COLUMN biography text not null;"; db.execSQL(ALTER_TBL); } } } </code></pre> <p>You can refer <a href="https://stackoverflow.com/questions/5687226/android-difficulty-in-upgrading-sqlite-table">this link</a> for more information about upgrading database.</p> <p><strong>Note :</strong> </p> <ul> <li><code>onCreate()</code> will only call when you are installing app for the first time only and <code>onUpgrade()</code> will only call when app is already installed and you are just updating it.</li> </ul> <p>Hope this will help you to solve your problem.</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.
    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