Dennis Cote <[EMAIL PROTECTED]> writes:

> Derrell,
>
> If you are using SQLite 3.3.0 or newer then you can do the same thing in a
> more direct manner using a CHECK constraint.
>
> CREATE TABLE x(i INTEGER PRIMARY KEY AUTOINCREMENT CHECK(i < (1<<32)));

Hehe.  I'm using 2.8.16 for most of my work, so I don't even have the
AUTOINCREMENT keyword available, let alone CHECK.

> Also, if you are concerned about signed vs unsigned interpretation of the 32
> bit value you may want to change the maximum to a 31 bit shift which will
> restrict i to values that are always positive signed values.

Hmmm... In the later versions of sqlite with 64-bit ROWID values, doesn't it
treat them as unsigned?  It sure seems that autoincremented rowid values
should always be positive...???

Cheers,

Derrell

Reply via email to