SQL Reference

Data Types

For information about specifying the data types of columns, see CREATE TABLE.

The smallest unit of data that can be manipulated in SQL is called a value. How values are interpreted depends on the data type of their source. The sources of values are:

DB2 supports a number of built-in datatypes, which are described in this section. It also provides support for user-defined data types. See User Defined Types for a description of user-defined data types.

Figure 9 illustrates the supported built-in data types.

Figure 9. Supported Built-in Data Types


Supported Built-in Data Types

Nulls

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.

Large Objects (LOBs)

The term large object and the generic acronym LOB are used to refer to any BLOB, CLOB, or DBCLOB data type. LOB values are subject to the restrictions that apply to LONG VARCHAR values as specified in Restrictions Using Varying-Length Character Strings. For LOB strings, these restrictions apply even when the length attribute of the string is 254 bytes or less.


[ Top of Page | Previous Page | Next Page ]