Home | Previous Page | Next Page   Data Types > Description of Data Types >

BYTE

The BYTE data type stores any kind of binary data in an undifferentiated byte stream. Binary data typically consists of digitized information, such as spreadsheets, program load modules, digitized voice patterns, and so on. The term simple large object refers to BYTE and text data types. No more than 195 columns of the same table can be declared as BYTE and text data types.

The BYTE data type has no maximum size. A BYTE column has a theoretical limit of 231 bytes and a practical limit that your disk capacity determines.

You can store, retrieve, update, or delete the contents of a BYTE column. You cannot, however, use BYTE operands in arithmetic or string operations, nor assign literals to BYTE columns with the SET clause of the UPDATE statement. You also cannot use BYTE items in any of the following ways:

BYTE operands are valid in Boolean expressions only when you are testing for NULL values with the IS NULL or IS NOT NULL operators.

You can insert data into BYTE columns in the following ways:

You cannot use a quoted text string, number, or any other actual value to insert or update BYTE columns.

When you select a BYTE column, you can choose to receive all or part of it. To retrieve it all, use the regular syntax for selecting a column. You can also select any part of a BYTE column by using subscripts, as the next example, which reads the first 75 bytes of the cat_picture column associated with the catalog number 10001:

SELECT cat_picture [1,75] FROM catalog WHERE catalog_num = 10001

A built-in cast converts BYTE values to BLOB values. For more information, see the IBM Informix: Database Design and Implementation Guide.

If you select a BYTE column using the DB–Access Interactive Schema Editor, only the string ''<BYTE value>'' is returned; no data value is displayed.

Important:
If you try to return a BYTE column from a subquery, an error results, even if the column is not used in a Boolean expression nor with an aggregate.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]