BINARY(size)

The BINARY data type is a fixed length data type that can contain any binary value. The minimum length of BINARY columns is 1 byte, and the maximum length is 3992 bytes. You must enter a value for the size parameter when creating a BINARY column. Any data entered in a BINARY column that is shorter than the column length is padded with a zero-value byte.

You can enter character data by enclosing the data in single quotes (' '), the same as when entering CHAR data. However, in BINARY columns the data is stored as hexadecimal values representing the ASCII code of the characters, not as the actual characters you entered.

You can also enter hexadecimal values directly by enclosing the data in single quotes and appending the 'x' character (' 'x) to indicate the string contains a hexadecimal value. Since it requires two digits to represent all possible values for each byte in hexadecimal, you must use an even number of digits when entering hexadecimal values.

e.g. 'AaBbCcDdEe'
  '41614262436344644565'x

< Contents | CHAR >

Copyright 2002 SYSCOM Computer Engineering Co. All rights reserved.