我在表上有一个复合主键(C1 + C2 + C3)。 这是DDL
CREATE TABLE "InputFiles" (
[PlantID] INTEGER,
[FileID] INTEGER,
[VesselDataCase] CHAR(9),
[Comments] CHAR(73),
Primary key([PlantID], [FileID]),
FOREIGN KEY(PlantId) REFERENCES Plant(PlantId) ON DELETE CASCADE);
CREATE TABLE [VesselData] (
[MaterialType] NVARCHAR(100) NOT NULL,
[Operating_Temperature] NUMERIC,
[IRTndt] numeric,
[VDID] integer,
[PlantId] integer,
[FileId] integer,
FOREIGN KEY([plantid], [fileid]) REFERENCES [inputfiles]([plantid], [fileid]) ON DELETE cascade,
CONSTRAINT [sqlite_autoindex_VesselData_1] PRIMARY KEY ([VDID], [PlantId], [FileId]));
When I try to insert a new row in VesselData Table
假设VDID = 1,Fileid = 2,Plantid = 3.因此它寻找(1 + 2 + 3)组合。 尽管表中没有具有这些值的字段,但它给了我 由于违反约束而中止 列VDID,PlantId,FileId不是唯一的SQlite异常
但是,它正在表中插入字段。插入此字段后,它给了我这个例外。由于无效的字段值,它不应该插入或中止
谢谢 太阳