Subject | Re: [firebird-support] External Tables |
---|---|
Author | Ann W. Harrison |
Post date | 2007-06-20T19:28:26Z |
hardygps wrote:
systems stored some types in different ways. Now, the only real
problems are endian.
Varchar must be on a two-byte boundary. The first two bytes are
the actual length of the field, but the field will be stored at
its full declared length.
Smallint is stored on 2 byte boundaries.
Int is stored on four byte boundaries, as is float.
bigint requires an eight byte boundary, as does double.
DateTime is stored as two 32-bit quantities on four byte boundaries.
Date and Time are 32 bit quantities on two byte boundaries.
2) if x < 5, small int with two byte boundaries
else if x < 10 integer on four byte boundaries
else if x < 19 bigint on eight byte boundaries
17, 1858
Ann
>The documentation is sparse because in the bad old days, different
> I'd appreciate if you could point me to any documentation on defining
> external tables with these column types as well as columns defined as
> date.
systems stored some types in different ways. Now, the only real
problems are endian.
>Char has no alignment requirement
> Here are some specific questions:
>
> 1. What are the alignment requirements for date, decimal, smallint,
> bigint, integer and char data items?
Varchar must be on a two-byte boundary. The first two bytes are
the actual length of the field, but the field will be stored at
its full declared length.
Smallint is stored on 2 byte boundaries.
Int is stored on four byte boundaries, as is float.
bigint requires an eight byte boundary, as does double.
DateTime is stored as two 32-bit quantities on four byte boundaries.
Date and Time are 32 bit quantities on two byte boundaries.
>1) the value stored equal to the actual value times 10 ** y.
> 2. How must a decimal(x, y) field appear in the external table?
2) if x < 5, small int with two byte boundaries
else if x < 10 integer on four byte boundaries
else if x < 19 bigint on eight byte boundaries
>A 32 bit integer representing the number of days since November
> 3. How must a date field appear in the external table?
17, 1858
>The number of tens of microseconds (I think) since midnight.
> 4. How must a time field appear in the external table?
>Not different from internal tables.
> 5. Is there a limit on the number of columns in an external table?
>The datatype discussion in Helen's book will certainly help.
> 6. Is there documentation on external tables that answer any of these
> questions?
>Cheers,
Ann