You don't need to define the PRIMARY KEY as NOT NULL - it's implied.
The column constraint flow diagram in the documentation in fact doesn't
allow it:
http://www.sqlite.org/syntaxdiagrams.html#column-constraint

Maybe that's the problem?  Try recreating the table without the NOT NULL
constraint on the "id" column and see if it works after that.

Thanks,
Nick.

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Brandon Wang
Sent: 01 December 2009 17:06
To: sqlite-users@sqlite.org
Subject: [sqlite] Possibly a bug in SQLite?

Hello,

I've come upon a interesting scenerio.

.sqlite> .schema rg_configuration
CREATE TABLE 'rg_configuration' (
    "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    "configurationName" TEXT NOT NULL,
    "host" TEXT,
    "user" TEXT,
    "parentArch" INTEGER NOT NULL,
    "parentJob" INTEGER NOT NULL,
    "parentSubblock" INTEGER NOT NULL,
    "parentBlock" INTEGER NOT NULL,
    "canBeRun" INTEGER DEFAULT (1)
);
[Addititonal indices, triggers, etc. here]

One of my scripts attempts to execute the following:

INSERT INTO main.rg_configuration (configurationName, parentArch,
parentJob, parentSubblock, parentBlock, canBeRun) VALUES
('full_chip.nofeedthru', 9565, 3014, 33, 8, 1);

Upon which I get the error:

SQL error: PRIMARY KEY must be unique

I'm not specifying the primary key, id. Is there some error on my part?

Thanks!

-Brandon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to