Subject | Re: [firebird-support] binary or string? |
---|---|
Author | Ann W. Harrison |
Post date | 2004-12-11T17:59:45Z |
At 12:22 AM 12/11/2004, Storage Box wrote:
value, you could call it char(1). But a table with an eight bit primary
key is kind of restrictive... 256 records and you're done. If you're
actually talking about an 8-byte binary key use int64. It's an exact
match.
hex or octal. Char is just binary with some fancy rules for comparisons,
like ignoring trailing blanks. Char with a specified character set and
collation has fancier rules - one particular character set called octets
cause a char string to compare exactly as the stored bytes compare -
nothing special about spaces.
Blobs are "Basic Large OBjects" with the emphasis on LARGE. Eight bits,
eight bytes, even 8 long words isn't large.
for longer strings of bytes, but since there's a native binary eight
byte type, I'd use that.
Regards,
Ann
>I'd like to use an 8-bit binary object as a primary key but I'm wonderinginteger suggests itself, though if you're actually using an eight bit
>what the most efficient way to store this is and how indexing will be
>affected.
value, you could call it char(1). But a table with an eight bit primary
key is kind of restrictive... 256 records and you're done. If you're
actually talking about an 8-byte binary key use int64. It's an exact
match.
>Blobs are binaryEverything on a computer is binary. And it can all be expressed as
hex or octal. Char is just binary with some fancy rules for comparisons,
like ignoring trailing blanks. Char with a specified character set and
collation has fancier rules - one particular character set called octets
cause a char string to compare exactly as the stored bytes compare -
nothing special about spaces.
Blobs are "Basic Large OBjects" with the emphasis on LARGE. Eight bits,
eight bytes, even 8 long words isn't large.
>The equivalent would be char(8) character set octets. And that's fine
>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?
for longer strings of bytes, but since there's a native binary eight
byte type, I'd use that.
Regards,
Ann