接收错误:";导入SQL失败;message=sqlite3“u prepare”v2故障:接近;如果是:语法错误“;在SQL语句中

接收错误:";导入SQL失败;message=sqlite3“u prepare”v2故障:接近;如果是:语法错误“;在SQL语句中,sql,sqlite,Sql,Sqlite,我有一个很长的SQL文件来为应用程序设置DB。我创建多个表: CREATE TABLE IF NOT EXISTS emotions (date TEXT, emotions TEXT); CREATE TABLE IF NOT EXISTS dates (date TEXT, textMorning TEXT, textAfternoon TEXT, textEvening TEXT); CREATE TABLE IF NOT EXISTS comboEmotions (emotion T

我有一个很长的SQL文件来为应用程序设置DB。我创建多个表:

CREATE TABLE
IF NOT EXISTS emotions
(date TEXT, emotions TEXT);

CREATE TABLE
IF NOT EXISTS dates
(date TEXT, textMorning TEXT, textAfternoon TEXT, textEvening TEXT);

CREATE TABLE
IF NOT EXISTS comboEmotions
(emotion TEXT, comboEmotion1 TEXT, comboEmotionColour1 TEXT, etc...)
然后,我尝试添加表“ComboMootions”,并使用以下格式的多个语句填充数据:

IF NOT EXISTS (SELECT * FROM comboEmotions WHERE emotion='joy')
BEGIN
INSERT INTO comboEmotions ('joy', 'none', 'none', 'love', '#C8D23F' ,'guilt', '#93BE4F', 'delight', '#98BD86', 'none', 'none', 'morbidness', '#CAA881', 'pride', '#E5824F', 'optimism', '#F2BA47');
END


IF NOT EXISTS (SELECT * FROM comboEmotions WHERE emotion='trust')
BEGIN
INSERT INTO comboEmotions ('trust', 'love', '#C8D23E', 'none', 'none', 'submission', '#65B744' ,'curiosity', '#6DB77A', 'sentimental', '#86B37C', 'none', 'none', 'dominance', '#B97E45', 'hope', '#C5B135');
END
它似乎要打断的行是以下语句:

IF NOT EXISTS (SELECT * FROM comboEmotions WHERE emotion='joy')
BEGIN

此语句的格式是否不正确?

使用
插入。。。选择
语法:

INSERT INTO comboEmotions(emotion, comboEmotion1, comboEmotionColour1, ....) 
SELECT 'joy', 'none', 'none', ...
WHERE NOT EXISTS (SELECT * FROM comboEmotions WHERE emotion='joy');

请参阅。

我删除了不一致的数据库标记。请标记您真正使用的数据库。