String sqlQueryToCreateUndergraduateDetailsTable = “create table if not exists ” + TABLE_NAME_GPA + ” ( ” + BaseColumns._ID + ” integer primary key autoincrement, ”
+”COLUMN_NAME” + ” text not null, ” +”COLUMN_SURNAME” + ” text not null, ” +”COLUMN_DATE_OF_BIRTH”+ “text not null, +”COLUMN_ADDRESS” +”text not null,” +”COLUMN_EMAIL” +”text not null,” +”COLUMN_PHONE_NUMBER” +”text not null,” +”COLUMN_CITY” +”text not null,” +”COLUMN_PTYE_PAYMENT” +”text not null,” +”COLUMN_SHIPPING_TYPE” +”text not null,” +”COLUMN_CARD_NUMBER” + “text not null,” +”COLUMN_Password” +”text not null);”;
I’m trying to save to a database but it giving me an error saying…..error code = 1, msg = table Customer_details_table has no column named “Card Number”
You cannot have spaces in table or column names.
Change it to
Card_NumberorCardNumberand it should work.EDIT
Looking at the error and what you said originally, I think you posted the wrong SQL.
You showed us your table creation SQL, but you say “I’m trying to save to a database”… And the error message seems to indicate that it was looking for a column, not trying to create one.
I think you need to look at your insert or update method SQL, where you probably typed it in manually instead of using the constant and accidentally put a space in there.