Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBhekimpilo Ncube
4,157 PointsBummer! Something is wrong with the statement: CREATE TABLE CAR_MAKERS (_id INTEGER PRIMARY KEY AUTOINCREMENT,ASSETTEXT
I don't get it, please help...
public class AutoSQLiteHelper extends SQLiteOpenHelper {
public static final String CAR_MAKERS = "CARS";
public static final String COLUMN_MEME_ASSET = "ASSET";
public static final String COLUMN_MEME_NAME = "NAME";
public static final String CREATE_CAR_MAKERS =
"CREATE TABLE CAR_MAKERS (_id INTEGER PRIMARY KEY AUTOINCREMENT," + COLUMN_MEME_ASSET + "TEXT" + COLUMN_MEME_NAME + "COMPANY_NAME)";
@Override
public void onCreate(SQLiteDatabase database) {
database.execSQL(CREATE_CAR_MAKERS);
}
}
2 Answers
Tatenda Kabike
4,163 PointsYour code has an error because you didn't put the field value "TEXT" for COLUMN_MEME_NAME column and also you skipped to put a comma on TEXT field variable for COLUMN_MEME_ASSET.Try to format your code to this , if an error occurs don't hesitate to ask me,Cheers happy coding!
="CREATE TABLE CAR_MAKERS (_id INTEGER PRIMARY KEY AUTOINCREMENT, " + COLUMN_MEME_ASSET + " TEXT," + COLUMN_MEME_NAME + "TEXT" + ")";
Harry James
14,780 PointsHey there!
For the first part of this challenge, you just want to add the key COMPANY_NAME
with the type TEXT
.
Remember that you need a ,
between each "command" and a space between the key and the type.
Hopefully this should have explained what you need to do on this question for you but if you're still having problems, give me a shout :)