binary
Specifies the data representation format of a field in imported or exported data as binary.
Applies to
Fields of all data types except string, ustring, and raw; record, subrec or tagged containing at least one field that is neither string nor raw.
Syntax
record { binary }
field_definition { binary };
This option specifies binary data; data is formatted as text by default (see text).
Meanings
The binary property has different meanings when applied to different data types:
- For decimals, binary means packed (see r_deeadvrf_packed.html).
- For other numerical data types, binary means "not text".
- For dates, binary is equivalent to specifying the julian property for the date field (see julian).
- For time, binary is equivalent to midnight_seconds (see midnight_seconds).
- For timestamp, binary specifies that the first integer contains a Julian day count for the date portion of the timestamp and the second integer specifies the time portion of the timestamp as the number of seconds from midnight; on export, binary specifies to export a timestamp to two 32-bit integers.
Restrictions
If you specify binary as a property of a numeric field, the data type of an imported or exported field must be the same as the corresponding field defined in a record schema. No type conversions are performed among the different numeric data types (as would be the case if text was specified instead).
This property is mutually exclusive with text, c_format, in_format, and out_format.
Examples
For example, the following defines a schema using binary representation for the imported or exported numeric fields with no delimiter between fields:
record { binary, delim = none } (
a:int32;
b:int16;
c:int8; )
"record {text} ( "
The following statement overrides the record-level setting of field b as text:
record {text} (
a:int32;
b:int16 {binary};
c:int8; )