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
>
After a bit more testing, it looks like there's a bit more to the 8-byte
NUMERIC / TIMESTAMP rule. The fields will start at bytes 0, 8, 16... if the
total number of fields is between 33 and 64, between 97 and 128, etc. In
other words, if floor((FieldCount - 1)/32) is odd.
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel