7.7. Data Types

Before continuing with our discussion of database objects, you need to understand the data types supported by DB2. A data type indicates what type of data can be saved in a column or variable and how large it can be. DB2 data types are either:

  • Built-in data types

  • User-defined types (UDTs)

7.7.1. DB2 Built-in Data Types

DB2 provides several built-in data types, which can be classified into the following categories:

  • Numeric

  • String

  • Datetime

  • Datalink

Figure 7.8 summarizes the built-in data types supported in DB2.

Figure 7.8. The DB2 built-in data types

7.7.1.1. Numeric Data Types

The numeric data types include the following:

  • Small integer ...

Get Understanding DB2®: Learning Visually with Examples now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.