DB2 Version 9.7 for Linux, UNIX, and Windows

Data types

The smallest unit of data that can be manipulated in SQL is called a value. Values are interpreted according to the data type of their source. Sources include:
  • Constants
  • Columns
  • Functions
  • Expressions
  • Special registers.
  • Variables (such as host variables, SQL variables, global variables, parameter markers, module variable, and parameters of routines)
  • Boolean values

DB2® supports a number of built-in data types. It also provides support for user-defined data types. Figure 1 shows the supported built-in data types.

Figure 1. The DB2 Built-in Data Types
The DB2 Built-in Data Types

All data types include the null value. The null value is a special value that is distinct from all non-null values and thereby denotes the absence of a (non-null) value. Although all data types include the null value, columns defined as NOT NULL cannot contain null values.

A Unicode database also supports national character strings which are synonyms for graphic strings.