i writing tests database , right table below not building , test failing sql command being built: " create table location (_id integer primary key,location_setting text unique not null, city_name text not null, coord_lat real not null coord_long real not null ); ". pretty there syntax error yet new databases in android , need help.
table creation:
@override public void oncreate(sqlitedatabase sqlitedatabase) { final string sql_create_location_table = "create table " + locationentry.table_name + " (" + locationentry._id + " integer primary key," + locationentry.column_location_setting + " text unique not null, " + locationentry.column_city_name + " text not null, " + locationentry.column_coord_lat + " real not null " + locationentry.column_coord_long + " real not null " + " );"; }
thanks help.
you need add ',' after every column leave last.
final string sql_create_location_table = "create table " + locationentry.table_name + " (" + locationentry._id + " integer primary key," + locationentry.column_location_setting + " text unique not null, " + locationentry.column_city_name + " text not null, " + locationentry.column_coord_lat + " real not null, " + locationentry.column_coord_long + " real not null" + " );";
Comments
Post a Comment