RE: [sqlite] Database Level Unique Sequence

2007-07-03 Thread Andre du Plessis
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

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Israel Figueroa
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

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Clark Christensen
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

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Teg
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

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread drh
"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: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Griggs, Donald
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

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread P Kishor
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