Nikola Velimirovic Nikola Velimirovic - 21 days ago 4
Android Question

Sqlite column doesn't exist

This is my problem; I'm creating tables from asset all are in one file and rest of the tables doesn't create any problem.

This one table is reporting:


04-29 22:13:09.434: E/SQLiteDatabase(6378):
android.database.sqlite.SQLiteException: table gym_exercise has no
column named date: , while compiling: INSERT INTO
gym_exercise(cals,date) VALUES (?,?)


and this is the create statement

create table gym_training (_id integer primary key autoincrement, cals integer not null, date text not null);


I tried renaming this column, tried not inserting value for that column and then I'm getting constraint error .

Answer

You've got the table names mixed up. You probably want to insert into gym_training, not gym_exercise.

Comments