Use TEXT and BYTE data types

The database server stores and retrieves TEXT and BYTE columns. To fetch and store TEXT or BYTE values, you normally use programs written in a language that supports embedded SQL, such as . In such a program, you can fetch, insert, or update a TEXT or BYTE value in a manner similar to the way you read or write a sequential file.

In no SQL statement, interactive or programmed, can a TEXT or BYTE column be used in the following ways:
  • In arithmetic or Boolean expressions
  • In a GROUP BY or ORDER BY clause
  • In a UNIQUE test
  • For indexing, either by itself or as part of a composite index
In a SELECT statement that you enter interactively or in a form or report, you can perform the following operations on a TEXT or BYTE value:
  • Select the column name, optionally with a subscript to extract part of it.
  • Use LENGTH(column_name) to return the length of the column.
  • Test the column with the IS [NOT] NULL predicate.

In an interactive INSERT statement, you can use the VALUES clause to insert a TEXT or BYTE value, but the only value that you can give that column is null. However, you can use the SELECT form of the INSERT statement to copy a TEXT or BYTE value from another table.

In an interactive UPDATE statement, you can update a TEXT or BYTE column to null or to a subquery that returns a TEXT or BYTE column.