Insertion error into a database table
<p>I'm really struggling to sort some issues inserting time and dates into a table in my database that dosent seem to excist!.</p>

<p>I asked a question on the 'no such table' issue but didn't get an answer that sorted this issue and circumstances have changed.</p>

<p>Really hoping someone can help me as i cant go forward until i solve this.</p>

<p>Edit:</p>

<p>Does the logcat show im trying to insert before creating the table?</p>

<p>Heres my Logcat error:</p>

<pre><code>01-20 23:38:24.128: E/Database(287): Error inserting app_time=00114200T000000Europe/Dublin(0,0,0,-1,0) app_alarm=false app_date=2013-01-24 app_name=gggg app_comments=a app_type=Business
01-20 23:38:24.128: E/Database(287): android.database.sqlite.SQLiteException: no such table: appointmentsTable: , while compiling: INSERT INTO appointmentsTable(app_time, app_alarm, app_date, app_name, app_comments, app_type) VALUES(?, ?, ?, ?, ?, ?);
</code></pre>

<p>Is it a case of this data cannot be inserted as there is no table? I have no idea why I cannot create a table. Im also confused as to why the values passed are '?'</p>

<p>Again here is my OnCreate method:</p>

<pre><code>@Override
    public void onCreate(SQLiteDatabase db) {


        db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
                KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                KEY_NAME + " TEXT NOT NULL, " +
                KEY_TEL + " TEXT NOT NULL, " +
                KEY_EMAIL + " TEXT NOT NULL, " +
                KEY_COMMENTS + " TEXT NOT NULL);"

                );

        db.execSQL("CREATE TABLE " + DATABASE_TABLEAPP + " (" +
                KEY_ROWAPPID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                KEY_NAMEAPP + " TEXT NOT NULL, " +
                KEY_TYPEAPP + " TEXT NOT NULL, " +
                KEY_TIMEAPP + " TEXT NOT NULL, " +
                KEY_DATEAPP + " TEXT NOT NULL, " +
                KEY_COMMENTAPP + " TEXT NOT NULL, " +
                KEY_ALARM + " BOOLEAN NOT NULL);"

                );      
    }
</code></pre>

<p>My insertion method:</p>

<pre><code>    public void createAppointmentEntry(String nameApp, String typeApp, Time timeApp, Date dateApp ,String commentApp, Boolean onOrOff) {



        ContentValues cv = new ContentValues();
        cv.put(KEY_NAMEAPP, nameApp);
        cv.put(KEY_TYPEAPP, typeApp);
        cv.put(KEY_TIMEAPP, timeApp.toString());
        cv.put(KEY_DATEAPP, dateApp.toString());
        cv.put(KEY_COMMENTAPP, commentApp);
        cv.put(KEY_ALARM, onOrOff);
        ourDatabase.insert(DATABASE_TABLEAPP, null, cv);

    }
</code></pre>
