Subject | RE: [firebird-support] binary or string? |
---|---|
Author | Storage Box |
Post date | 2004-12-11T06:10:26Z |
Yeah, that sounds right, especially since it is a hexadecimal value (if that
wasn't obvious). I'll check out char. sets, I'm not familiar but I'll see
what I can see.
Internally it is just incremented. It is the hex equivalent of the high +
low values of a 32-bit integer. I create it and then increment one of the
integers to guarantee each OID is unique until I run out of integers on both
sides (high & low). It only takes about 20 lines of code to manage this
process.
I handle the prefix and other validation in my application's data-layer as I
want to keep the app database-independent so really, a char(16) would work
just fine I guess (it's always 16 characters).
Thanks!
_____
From: Helen Borrie [mailto:helebor@...]
Sent: Friday, December 10, 2004 10:37 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] binary or string?
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
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=129oh5cm1/M=298184.5639630.6699735.3001176/D=gr
oups/S=1705115386:HM/EXP=1102830081/A=2434971/R=0/SIG=11eeoolb0/*http://www.
netflix.com/Default?mqso=60185400> click here
<http://us.adserver.yahoo.com/l?M=298184.5639630.6699735.3001176/D=groups/S=
:HM/A=2434971/rand=282456583>
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]
wasn't obvious). I'll check out char. sets, I'm not familiar but I'll see
what I can see.
Internally it is just incremented. It is the hex equivalent of the high +
low values of a 32-bit integer. I create it and then increment one of the
integers to guarantee each OID is unique until I run out of integers on both
sides (high & low). It only takes about 20 lines of code to manage this
process.
I handle the prefix and other validation in my application's data-layer as I
want to keep the app database-independent so really, a char(16) would work
just fine I guess (it's always 16 characters).
Thanks!
_____
From: Helen Borrie [mailto:helebor@...]
Sent: Friday, December 10, 2004 10:37 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] binary or string?
At 10:22 PM 10/12/2004 -0700, you wrote:
>I'd like to use an 8-bit binary object as a primary key but I'm wonderingfor
>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",
>example "0x0000A105B4C5D6F2"...so, would it be best to store it as ajust
>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
>need to know how to best store it as a PK and enforce uniqueness.I don't know anything about this datatype or what happens to it
>
>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
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=129oh5cm1/M=298184.5639630.6699735.3001176/D=gr
oups/S=1705115386:HM/EXP=1102830081/A=2434971/R=0/SIG=11eeoolb0/*http://www.
netflix.com/Default?mqso=60185400> click here
<http://us.adserver.yahoo.com/l?M=298184.5639630.6699735.3001176/D=groups/S=
:HM/A=2434971/rand=282456583>
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]