Subject Re: [ib-support] auto increase
Author Paul Schmidt
Ricardo:

On 11 Jun 2001, at 15:47, Ricardo Striquer Soares wrote:

> i am developing my fist interbase DB in wich i would like
> to use a
> double auto_increment oracles type please can anyone tell
> me haw does
> this script below got to looks like for create a table in
> interbase. or just haw to create an auto increase number
> if it does have a way to do it !

Auto incrementing fields in InterBase are implemented as generators,
which are Integer values (32bit integers in Dialect 1, and 64bit
integers in Dialect 3). This leads to three possible solutions, the
first is to cast the generator to a double, The second is to store
it as a generator value and fake the decimal point (for example
storing 9.95 as 995). I don't know if it would like casting an Int64
to a double, because I would rather not use a double as a primary
key. This is because doubles are not that precise, it's too easy to
get weird values. Like 1.2 x 1 being equal to 1.239485587505479 or
some other such nonsense (whether 1.2 x 1 doing this or not, I am not
sure, but there are a lot of values that do).

Paul










Paul Schmidt,
Tricat Technologies
Email: paul@...
Website: www.tricattechnologies.com