1 1 14 Binary

LANSA Technical

1.1.14 Binary

Binary is a fixed-length binary field, with a length between 1 and 32,767. Binary fields with lengths of 256 or less are equivalent to the existing Alpha field with the SBIN attribute enabled.

Binary fields are used to store binary data. This data is not subject to codepage conversion.

Please review the general 1.1.1 Field Type Considerations.

Field Definition Rules

Rules for defining a Binary field in the repository are:

Length

Binary fields may be 1 to 32,767 in length. Binary fields have no decimals.

Valid Keyboard Shift

Blanks

Allowed Attributes

AB, ASQN, CS, FE, ND, RA, RL, RLTB.

Edit Mask

Not allowed.

Default

*SQLNULL. ASQN will be enabled by default.

Field Definition Notes

  • There is NO difference between Binary and VarBinary except how they are stored in the database.

Usage Rules

Partition Type

RDMLX Enabled Partition

Files

Binary fields may only be used in RDMLX Files. Binary fields may be used as real fields. Binary fields may not be used as key fields.

Logical Views

Binary fields may not be used as key fields.

Virtual Fields

Binary fields may be used with Code Fragment Virtual Fields.

Predetermined Join Fields

Binary fields may be used for lookup predetermined joined fields.

RDML Commands

DEF_HEAD, DEF_FOOT, DEF_BREAK, and DEF_LINE will not support printing of fields of type Binary. A FFC error will be generated if these Binary fields are used.

Binary fields are manipulated as if they are Char fields except where sensitivity to their Binary characteristics will be incorporated.

Built-In Functions

When used in Built-In Functions, Binary fields are classified as their own types and are not valid for numeric or alpha arguments.

Special Values

*NULL, *NAVAIL, *REMEMBERED_VALUE

Conversion

Binary fields may be converted to character type fields. Refer to Field Type Conversions.

Usage Notes

  • Working fields may be defined as TYPE(*BIN).
  • If an SQL WHERE clause will/may be generated by a condition, these field types may only be compared to *NULL or *SQLNULL; any other comparison will be rejected.

Warnings

  • Binary is treated as a fixed length type by some databases. Thus they pad the unused length and the padding character also differs between different databases. Other databases may treat it as variable length and thus not pad it at all. If data is then compared before and after, the result of the comparison will differ depending on the database that is being used. VarBinary is never padded and thus always compares correctly. Recommendation is to use VarBinary unless the binary data is always the same length

Platform Considerations

Also See

1.1.15 VarBinary

Ý 1.1 Field Types