DB2 10.5 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
A number of built-in data types are supported. Figure 1 shows the supported built-in data types. Support for the following user-defined data types is also provided:
  • Array
  • Cursor
  • Distinct
  • Row
  • Structured
Figure 1. Built-in Data Types
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.