hhmmm... i just noticed something weird. if i insert a string of ANY length or format into the uniqueidentifier field, sqlite allows it...

insert into foobar values("{68753A44-4D6F-1225-9C60-0050E4C00067}", "Aaa", "Bbb");
insert into foobar values("whatever", "Ccc", "Ddd");

select * from foobar;

   id                                        foo    bar
   ____________________________________________________

   {68753A44-4D6F-1225-9C60-0050E4C00067}    Aaa    Bbb
   whatever                                  Ccc    Ddd



so i guess it's just a text type under the hood with no rules enforced on the format of the string inserted into it.

not sure if i like that.

- chase

ps: thanks for the help on generating a guid.


On July 27, 2007, Chris Wedgwood wrote:

On Fri, Jul 27, 2007 at 01:47:33PM -0700, Chris Wedgwood wrote:

{946D4A14-3A72-45F9-E162-0C397A}

Actually, I misfired, you need '6' for the last size to ranomblob, so:

sqlite> select "{" || hex(randomblob(4)) || "-" || hex(randomblob(2)) || "-" || hex(randomblob(2)) || "-" || hex(randomblob(2)) || "-" || hex(randomblob(6)) || "}";
{4EA4A842-6ACA-0A81-5B42-F9E1D295BC27}

might work...



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

Reply via email to