Subject Re: Guid Support in Firebird
Author Ian A. Newby
Hi Sean,
Thanks for your response.

> Interestingly (depending on your point of view) _I thought_ I
heard that
> MS had changed there logic along the way, due to the
relatively "static"
> nature of there GUID which they returned/created. So the 'format'
> their GUID might change depending on the OS version.

I have read that there are two main methods of guid generation,
random and created. As far as I am aware windows platforms don't
have a good enough random number generator to use the random method.
I have read a document on UUID's (I think its a OSF document) which
describes the method Microsoft use (and I thought guids were a
microsoft thing!).

> > Would it be possible to re-use the GEN_ID function with no
> > parameters to generate a guid? is it desirable?
> Please elaborate on your proposed solution/idea.

Calling gen_id with no parameters such as "select gen_id from
rdb$database" could return a guid. This would not require the
introduction of new reserved words.

> The answer to this question depends on how you feel about
transcribing a
> 26 or 31 char value by hand (without making a mistake). As far as
> system/indexing is concerned, the difference between
> formatted/unformated is not worth thinking about. So, the answer
> really a personal choice. {My own vote would be for a formatted

I suppose if it was done properly in the engine the method could be
to store it as char(8) char set octets? but display it as 31
characters when returned via sql. I suppose you could use cast(guid
as char (26/31)) as an alternative. This would ease any index length

Ian Newby