Problem with AUTO INCREMENT

This is the international (english) support forum for the SQLite Administrator developed and maintained by Orbmu2k.

Moderators: gto, EgonHugeist, Orbmu2k

Locked
fbuchinger
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 31.03.2007, 16:51

Problem with AUTO INCREMENT

Post by fbuchinger »

It seems quite tempting to activate the "Auto Increment" checkbox in the "Change table field" Dialogue of SQLite Administrator. However, this function seems to PREVENT Sqlite from generating Auto Increment IDs.

I had no success with the resulting SQL-Statement:

CREATE TABLE [image] (
[id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[filename] VARCHAR(255) NOT NULL
)

but when I changed to

CREATE TABLE [image] (
[id] INTEGER PRIMARY KEY,
[filename] VARCHAR(255) NOT NULL
)

my table showed the desired behaviour.
Orbmu2k
SQLite Admin Developer
SQLite Admin Developer
Posts: 38
Joined: 07.12.2005, 07:51
Contact:

Post by Orbmu2k »

There is a difference in auto increment handling between sqlite 2.8 and sqlite 3. on sqlite 2.8 databases you do not need the AUTOINCREMENT flag because its not supported by sqlite 2.8 ... but INTEGER PRIMARY KEY does quiet the same on sqlite 2.8.
Locked