Re: informix database format
Posted in 1996
Mauro Minenna <minenna@a2500.cra.enel.it> wrote: :Hi, :I would like to know something more about the internal format of an :informix DB. The content of .idx and .dat files and so on... :Could anybody help me? (A RTFM answer is appreciated too if you state :what manual I should read to gather that info). Why do you need this? You should be *very* carefull doing anything to the data without using the engine. You state nothing about what version it is, but as you have .idx and dat files it must be some version of SE. Until ver. 5.x at least all records where fixed length and 1 byte longer than the rowlength. The extra byte is a line feed at the end of each record, except on delete records where this byte was set to 0 hex. Each column in the table are stored as fixed length with different format for each datatype. Character columns simply contains the data with spaces at the end. If the first byte is 0 hex that column contains a null "value". Integers and floats are in the C-format of the compiler on your platform. Decimals are stored with to digits to the byte. Each byte has binary values from 0 to 99 to represent the two digits. There is also a byte representing the scale in some form that I don't know. I think that's the first byte in the decimal field, and if this is 0 the value is null. That's about as much as I know. Mostly found out via the hd-command on unix once I had to restore a crashed database many years ago. Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org