From: Chris W. <ch...@co...> - 2004-04-27 16:55:20
|
I know that the Firebird database doesn't support GUIDs however I have an extremely helpful document that I found on the net that discusses transitioning from SqlServer to Firebird. The doc suggests using a string representation of a Guid instead. But I think that is an unacceptable suggestion. Using that technique Guids are defined as CHAR(36) or CHAR(38) (if you surround the string rep with curly braces). This is unacceptable as GUID are 16-byte (128-bit) values and in may databases used as OID thus quite pervasive. The question is how to use a 16-byte GUID in Firebird when the system itself doesn't. In the database that I'm designing with Firebird I decided to reserve CHAR(16) for GUID only. If I have a need for a 16-byte character representation then I'll use either VARCHAR(16) or CHAR(17). In the CHAR(17) case I'm anticipating the front end to limit user input. Using this definition then the Firebird.NET provider can then determine and support 16-byte guids. I made some modifications in FbCommand.cs, GDS\GdsInetReader.cs and GDS\GdsInetWriter.cs (I'm got to get to work now so I'll publish the mods in a subsequent email). But my point is that the provider (perhaps using a compiler switch) should provide "guid" support into Firebird. On the Firebird side using a very simple UDF you can also generate GUIDs this I use an empty guid to indicate insert and a non-empty guid to indicate update. My changes however only work if you are using stored procedures as that is the only code path I really interested in. But if this sound plausible and reasonable I think that since .NET makes GUIDs easy to use and is fully supported in SQLServer it will assist many SQLServer programmer to migrate the data base over to Firebird. Thanks, Chris |