我想在一個SQLite(最新版本)表中插入多行,但是將引發一個錯誤SQLite中插入多行
上心從HERE這裏是我的SQL查詢:
INSERT INTO "Track"
SELECT "Leonard Collections" AS "Album",
"Instrumental" AS "Artist",
"00:02:59.3800000" AS "Duration",
"1/1/0001 12:00:00 AM" AS "ReleasedDate",
"If You Love Me" AS "Title",
"False" AS "IsPlayableOnLocal"
UNION
SELECT "Leonard Collections",
"Instrumental",
"00:02:56.6930000",
"1/1/0001 12:00:00 AM",
"Espoir",
"False",
UNION
SELECT "Leonard Collections",
"Instrumental",
"00:03:51.6770000",
"1/1/0001 12:00:00 AM",
"Don't Cry For My Argentina",
"False"
但它拋出
SQL logic error or missing database
near "UNION": syntax error
這是我的表結構
CREATE TABLE Track
(
ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
Album VARCHAR(100) NULL ,
Artist VARCHAR(255) NOT NULL DEFAULT "Artist Unknown",
Duration VARCHAR(255) NOT NULL ,
LocalPath VARCHAR(255) NULL ,
ReleasedDate DATE NOT NULL ,
Title VARCHAR(255) NULL ,
IsPlayableOnLocal INTEGER NOT NULL ,
Rating VARCHAR(255) NULL
)
我的查詢有問題嗎?
任何幫助,將不勝感激。
TIA
SQLite版本設備是否依賴? –
是和不是。 SQLite是一個庫。如果你正在使用(舊的)共享SQLite庫,那麼它將依賴於它。但是,您可以使用新版本的靜態鏈接來避免設備依賴性 – mvp