Subject RE: [firebird-support] binary or string?
Author Storage Box
I don't need Firebird to do anything but efficiently store the value. My
application handles converting/manipulating the values...I was simply
looking for the most possible efficient data-type to store them as primary
keys in Firebird tables.

Folks here have pointed out that a bigint is a natural fit and the most
efficient type for a key of this type.

On second thought, what is the equivalent in Firebird to "binary(4)" and
"binary(8)" data types in MS SQL Server? It wouldn't take much to convert
the stored procedure and use it internally with a database table instead.

An OID in T-SQL is created by simply combining two integers cast as
"binary(4)" into a binary(8) variable.

Some pseudo, pseudo-code:

declare @OID binary(8)
declare @high int
declare @low int

Set @OID = Cast(@low as binary(4)) + Cast(@high as binary(4))

-v

_____

From: Ivan Prenosil [mailto:Ivan.Prenosil@...]
Sent: Monday, December 13, 2004 3:28 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] binary or string?


> A bigint would be overkill since it is not a 64-bit value. So, a
int/bigint
> field can legally store hexadecimal values?

Store ? "hexadecimal" is just one of many possible
representations/formatting
of values. i.e. number 10 can also be represented as
00000000000000000000000000001010 (binary), or
00000000012 (octal), or
000A (hexadecimal), etc.
Or do you really need (why?) to pass string with hexadecimal value and let
Firebird
to convert it automatically ?

Ivan



Yahoo! Groups Sponsor

ADVERTISEMENT

<http://us.ard.yahoo.com/SIG=129kuqetb/M=294855.5468653.6549235.3001176/D=gr
oups/S=1705115386:HM/EXP=1103020130/A=2455396/R=0/SIG=119u9qmi7/*http://smal
lbusiness.yahoo.com/domains/> click here

<http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=groups/S=
:HM/A=2455396/rand=377569105>

_____

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]