Hi All

We are trying to implement a bulk data importer by writing our own external
table files. We've tried storing all fields as text, but due to the volume
of data, this put us well over the 2GB external file size limit in Firebird
2.1. So we've resorted to saving the files in Firebird's own binary format.

To simplify things a little, we only need to deal with CHAR, NUMERIC and
TIMESTAMP fields.

The data formats were easy enough to figure out. However, the byte
alignment rules for some field types are a little baffling. From what I've
seen:
- CHAR fields can start at any position within a row
- 2-byte NUMERIC fields can start at bytes 0, 2, 4...
- 4-byte NUMERIC fields can start at bytes 0, 4, 8...
- 8-byte NUMERIC / TIMESTAMP fields:
-- Can start at bytes 0, 8, 16... as long as either:
--- The first field in the table is an 8-byte NUMERIC / TIMESTAMP, or
--- The table contains more than 32 fields in total
-- Otherwise, can start at bytes 4, 12, 20...

Is this right? Is there anything I'm missing? We didn't get very far
digging around in the source code.

Thanks
Huan
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to