Subject | Re: [firebird-support] binary or string? |
---|---|
Author | Helen Borrie |
Post date | 2004-12-11T05:36:32Z |
At 10:22 PM 10/12/2004 -0700, you wrote:
internally; but I think what you want is a varchar(16) or char(16)
character set BINARY (a.k.a. character set OCTETS). You might also want
first to define a domain with a check constraint to restrict the allowed
characters and enforce the prefix, especially if you will have other tables
referring to it through foreign keys.
./heLen
>I'd like to use an 8-bit binary object as a primary key but I'm wonderingI don't know anything about this datatype or what happens to it
>what the most efficient way to store this is and how indexing will be
>affected.
>
>The object can be expressed as a 16-character string prefixed with "0x", for
>example "0x0000A105B4C5D6F2"...so, would it be best to store it as a
>varchar? I have a middleware object written in C# that converts it to the
>appropriate values in order to increment it and manage it internally, I just
>need to know how to best store it as a PK and enforce uniqueness.
>
>Blobs are binary but obviously that isn't even an option as they are not
>indexed (from what I've read, I could be wrong?). Even if they can be
>indexed, I'm sure the performance would suffer.
>
>In SQL Server I would store them as a binary(8) object (not a blob) but I'm
>not sure what the equivalent would be in FB?
internally; but I think what you want is a varchar(16) or char(16)
character set BINARY (a.k.a. character set OCTETS). You might also want
first to define a domain with a check constraint to restrict the allowed
characters and enforce the prefix, especially if you will have other tables
referring to it through foreign keys.
./heLen