I am using sqlite3 and trying to put data into my database.
INSERT INTO Structure VALUES
('521D5E7ABC165','1','DECODE','T','4','Y','Y'),
('521D5E7ABC165','2','DEDESC','T','40','N','Y'),
('521D5E7ABC165','3','DDZMD8','T','10','N','Y'),
('521D5E7ABC165','4','DDZMTM','T','8','N','Y'),
('521D5E7ABC165','5','DDZMID','T','10','N','Y'),
('521D5E7ABC165','6','DDZMTL','T','10','N','Y'),
('521D5E7ABC165','7','DDZMBR','T','5','N','Y'),
('521D5E7ABC165','8','DDZND8','T','10','N','Y'),
('521D5E7ABC165','9','DDZNTM','T','8','N','Y'),
('521D5E7ABC165','10','DDZNID','T','10','N','Y'),
('521D5E7ABC165','11','DDZNTL','T','10','N','Y'),
('521D5E7ABC165','12','DDZNBR','T','5','N','Y')
I try executing the command in DBBrowser for SQLLITE it works but when i try to execute through System.Data.SQLite.dll - ExecuteNonQuery it return me error :
"SQLite error near ",": syntax error"
Can anyone help ?
Here is the table structure
CREATE TABLE `Structure` (
`HeaderID` TEXT,
`SeqNo` INTEGER,
`FieldName` TEXT,
`FieldType` TEXT,
`FieldLength` TEXT,
`IsKey` TEXT,
`IncludeRecord` TEXT,
PRIMARY KEY(`HeaderID`,`SeqNo`)
);
and the sqlite3 version is : 3.15.2
1 Answer 1
Works for me with the SQL directly copied from your question (plus a terminating ;).
% sqlite3 so.sqlite3
SQLite version 3.11.0 2016年02月15日 17:29:24
Enter ".help" for usage hints.
sqlite> CREATE TABLE `Structure` (
...> `HeaderID` TEXT,
...> `SeqNo` INTEGER,
...> `FieldName` TEXT,
...> `FieldType` TEXT,
...> `FieldLength` TEXT,
...> `IsKey` TEXT,
...> `IncludeRecord` TEXT,
...> PRIMARY KEY(`HeaderID`,`SeqNo`)
...> );
sqlite> INSERT INTO Structure VALUES
...> ('521D5E7ABC165','1','DECODE','T','4','Y','Y'),
...> ('521D5E7ABC165','2','DEDESC','T','40','N','Y'),
...> ('521D5E7ABC165','3','DDZMD8','T','10','N','Y'),
...> ('521D5E7ABC165','4','DDZMTM','T','8','N','Y'),
...> ('521D5E7ABC165','5','DDZMID','T','10','N','Y'),
...> ('521D5E7ABC165','6','DDZMTL','T','10','N','Y'),
...> ('521D5E7ABC165','7','DDZMBR','T','5','N','Y'),
...> ('521D5E7ABC165','8','DDZND8','T','10','N','Y'),
...> ('521D5E7ABC165','9','DDZNTM','T','8','N','Y'),
...> ('521D5E7ABC165','10','DDZNID','T','10','N','Y'),
...> ('521D5E7ABC165','11','DDZNTL','T','10','N','Y'),
...> ('521D5E7ABC165','12','DDZNBR','T','5','N','Y');
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE `Structure` (
`HeaderID` TEXT,
`SeqNo` INTEGER,
`FieldName` TEXT,
`FieldType` TEXT,
`FieldLength` TEXT,
`IsKey` TEXT,
`IncludeRecord` TEXT,
PRIMARY KEY(`HeaderID`,`SeqNo`)
);
INSERT INTO "Structure" VALUES('521D5E7ABC165',1,'DECODE','T','4','Y','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',2,'DEDESC','T','40','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',3,'DDZMD8','T','10','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',4,'DDZMTM','T','8','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',5,'DDZMID','T','10','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',6,'DDZMTL','T','10','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',7,'DDZMBR','T','5','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',8,'DDZND8','T','10','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',9,'DDZNTM','T','8','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',10,'DDZNID','T','10','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',11,'DDZNTL','T','10','N','Y');
INSERT INTO "Structure" VALUES('521D5E7ABC165',12,'DDZNBR','T','5','N','Y');
COMMIT;
answered Apr 27, 2018 at 10:46
user9455968
Sign up to request clarification or add additional context in comments.
Comments
lang-sql
select sqlite_version();to find out.SeqNois an integer column