sorry.  should have been more specific.  i'm talking about guids (or uuids).

here's the create table line:

CREATE TABLE foobar (id uniqueidentifier, foo text, bar text, PRIMARY KEY (id));

that works great, but i have not been able so far to generate a fresh guid to insert into the table.

in ms-sql, you'd use newid(), for example:

insert into foobar values (newid(), "Aaa", "Bbb");

and then you'd get something like:

select * from foobar;

   id                                        foo      bar
   ___________________________________________________________

   {00000109-0000-0010-8000-00AA006D2EA4}    "Aaa"    "Bbb"


so how is this done in sqlite3?

- chase




On July 27, 2007, Mark Richards wrote:

Chase wrote:

how do i generate a uniqueidentifier ?
Define a column as follows:
        {fieldname} INTEGER NOT NULL PRIMARY KEY

eg:

CREATE TABLE hardware_types (record_key INTEGER NOT NULL PRIMARY KEY,hardware_key INTEGER default 0);

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to