请解决此sqlite错误

时间:2016-03-31 16:49:47

标签: sql sqliteopenhelper

Caused by: android.database.sqlite.SQLiteException: no such column: Over_the_horizon.mp3 (code 1): , while compiling: insert into musics(song_name,album_name,artist_name,full_path) values(Over_the_horizon.mp3,Samsung,Samsung,a/storage/emulated/0/Samsung/Music/Over_the_horizon.mp3) 

1 个答案:

答案 0 :(得分:2)

SQL中的字符串文字用单引号(')表示,缺少values子句。 添加它们就可以了:

INSERT INTO musics 
(song_name, album_name, artist_name, full_path) 
VALUES ('Over_the_horizon.mp3',
        'Samsung',
        'Samsung',
        'a/storage/emulated/0/Samsung/Music/Over_the_horizon.mp3')