From: Peter J. <pj...@wa...> - 2004-04-28 07:33:21
|
Hi Chris, > I've tried storing this with Firebird and it seems to work. Did your test include cases where the GUID did contain bytes of value zero? On average 1/16th of all GUID of should have this "feature"? > Firebird seem > to treat CHAR types as merely as an array of bytes and doesn't seem to > attempt any other interpretations. Only CHARACTER SET OCTETS is designed to be a mere array of bytes, so that I'm curious whether your test worked without specifying the character set. > With that knowledge and if you are > developing a new database project make it a guideline that only GUID > entities are defined as CHAR(16). CHAR(16) CHARACTER SET OCTETS > The only issue is reading from Firebird into the .NET provider as it will > "think" a GUID is a Firebird TEXT type. The way for the provider to > distinguish that the data coming across is a guid is for the provider to > check the size. If the data is TEXT by and size is 16 then assume a GUID > and convert the byte stream to a GUID -- wal-la! I don't know whether the provider already includes special casing for character set octets, perhaps Carlos should comment on this. Also short of adding a new type, a new (pseudo) character set can be created, which behaves mostly like OCTETS but uniquely identifies the field as being an GUID. It's even possible to make the stringification of the GUID a character set conversion to ASCII, if this buys anything. Regards, Peter Jacobi |