be great to an already great project.
Cheers.
-Original Message-
From: Israel Figueroa [mailto:[EMAIL PROTECTED]
Sent: 03 July 2007 04:06 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Database Level Unique Sequence
I think that what you need is a sequence... but sqlite doesn't
I think that what you need is a sequence... but sqlite doesn't implement
sequiences. A workarround cuold be to create a table with no data on it..
but used to create a unique index which can be used to insert data on the
others tables. To know the id you should use the sqlite3_last_insert_rowid
http://www.mail-archive.com/sqlite-users@sqlite.org/msg10803.html
Describes a patch that implements a sequence table, and functions to deal with
it. You could use something like that to implement a unique-across-all-tables
ID scheme. Though I think someone else (Igor?) already suggested
Hello Andre,
I'd probably add a single table that does nothing but, supply
auto-increment values to the other tables. You'd only have
"autoincrement" in this one table then when you need a unique number,
insert into the link table, get the rowid/autoincrement value and then
use this value for the
"P Kishor" <[EMAIL PROTECTED]> wrote:
> On 7/2/07, Andre du Plessis <[EMAIL PROTECTED]> wrote:
> >
> > I would like to know how to create an Autoincrement field and insure
> > that it is unique across the database,
>
> 1. Use a GUID, or
> 2. Use some kind of crypt/md5 kinda function on a random
Re: "I would like to know how to create an Autoincrement field and
insure that it is unique across the database [not just within one
table]...]
Hi Andre,
Do you mind saying why it is you need the field to be unique across all
tables? Wouldn't the fact that a key is unique within its own table
On 7/2/07, Andre du Plessis <[EMAIL PROTECTED]> wrote:
Good day everyone.
I would like to know how to create an Autoincrement field and insure
that it is unique across the database, I tested this and it does not
seem to work:
..
1. Use a GUID, or
2. Use some kind of crypt/md5 kinda function
7 matches
Mail list logo