0

i created the database like this

db.execSQL("CREATE TABLE "+TABLE_NAME+" (" 
    +_ID+" INTEGER PRIMARY KEY AUTOINCREMENT," 
    + TITLE+" TEXT UNIQUE," 
    + PUBLISHED+" DATETIME," 
    + CONTENT+" TEXT," 
    + RATERS+" TEXT,"
    + VIEWCOUNT+" TEXT,"
    + THUMBNAIL+" TEXT,"
    + FAVCOUNT+" TEXT,"
    + FAVSTAT+" INTEGER,"
    + LINKWEB+" TEXT);");

i got an exception when i try to insert the values in the table??

02-24 15:57:37.802: ERROR/DatabaseUtils(283): Writing exception to parcel
02-24 15:57:37.802: ERROR/DatabaseUtils(283): android.database.sqlite.SQLiteException: table bru_tube has no column named linkweb: , while compiling: INSERT INTO bru_tube(content, favstat, title, thumbnail, linkweb, raters, viewcount, published, favcount) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?);
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteProgram.native_compile(Native Method)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:59)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:41)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1026)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1412)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1307)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at com.brownuniv.brutube.BruTube_Provider.insert(BruTube_Provider.java:82)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:150)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:140)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.os.Binder.execTransact(Binder.java:287)
02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at dalvik.system.NativeStart.run(Native Method)

how to solve it??? any idea?

5 Answers 5

3

Are you sure that the LINKWEB variable also contains the text "linkweb"? Maybe a spelling mistake. You can use ADB to connect to the emulator and view the database - maybe that helps (see this document).

Sign up to request clarification or add additional context in comments.

1 Comment

As Thorsten said, make sure you have the correct table schema in your database . From the link above, have a look at the section "Examining sqlite3 Databases from a Remote Shell"
1

checkout there exists column "linkweb" in your table

Comments

0

Use sqlite3 from command line on the emulator or on your desktop to verify that what you are trying to achieve is correct and has no syntax errors. Also verify the schema after table creation.

Comments

0

i think that there is not any column name linkweb.

Comments

0

i think you are missing space after writing text

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.