In an OceanBase database, each column in a table is assigned with a data type, and each data type has its own storage format, constraints, and value range. This topic describes the built-in data types that are most commonly used in OceanBase Database.
The following built-in data types are most commonly used in OceanBase Database:
Character data types
Numeric data types
Datetime data types
ROWID data types
Multi-model data types
- JSON data types
- XML data types
- Spatial data types
Other important data types include RAW, large object (LOB), and set. In procedural language (PL), you can also specify the BOOLEAN, reference, composite (including COLLECTION and RECORD), and other custom data types for constants and variables.
Data types associate a fixed set of attributes with data. The attributes enable OceanBase Database to process different types of data in different ways. For example, you can perform multiplications on NUMBER data but not RAW data.
When you create a table, you must specify a data type for each column in the table. Data inserted into the column must match the data type.