Notice
When you use the DECIMAL type as the partitioning key and use ODP to connect to OceanBase Database, make sure that the ODP version is V4.2.3 or later to ensure accurate routing.
Fixed-point types are variable-length, exact numeric types. The value range and precision depend on the precision and scale, and whether the type is unsigned.
DECIMAL is equivalent to NUMERIC. The syntax is as follows:
DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]
M specifies the total number of digits (precision), and D specifies the number of digits to the right of the decimal point (scale). The decimal point and the minus sign "-" are not counted in M. If D is 0, the value has no decimal point or decimal part. The maximum number of digits in the integer part is equal to the value of M minus D, that is, the value of precision minus scale. All basic operations on columns of the DECIMAL type (+, -, *, /) use 65-bit precision.
The maximum value of M for DECIMAL is 65, and the maximum value of D is 30. If you omit D, the default value is 0. If you omit M, the default value is 10.
If you specify ZEROFILL for a numeric column, OceanBase Database automatically adds the UNSIGNED attribute to the column. If you specify UNSIGNED, the value cannot be negative.
For example, DECIMAL(5,2) specifies a maximum of 3 digits in the integer part and 2 digits in the decimal part. The value range is [-999.99, 999.99]. If you also specify UNSIGNED, the value range is [0, 999.99].
The following types are synonyms for DECIMAL. FIXED is used for compatibility with other database systems.
DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED] [ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]
