Scalar function
Returns NULL for a NULL operand or integer/decimal overflow. Floating-point overflow remains infinity.
Syntax
Scalar
Arguments
Returns
- Type: The common converted integer or floating type; DECIMAL(p, s) from the multiplication precision/scale rule for decimal inputs
- Possible values: The numeric product.
- NULL behavior: Returns NULL for a NULL operand or integer/decimal overflow. Floating-point overflow remains infinity.
Properties
- Approximation bound: No fixed bound is declared for floating-point products.
Usage notes
- Nondecimal factors are converted to a common numeric type before multiplication. Decimal factors keep their individual precision and scale.
- For DECIMAL(p1,s1) and DECIMAL(p2,s2), natural precision is p1 + p2 + 1 and natural scale is s1 + s2. If natural precision is at most 38, those values form the result type.
- When natural precision exceeds 38, result precision is 38 and result scale is min(s1 + s2, max(38 - ((p1-s1) + (p2-s2) + 1), 6)). Scale reduction rounds halfway values away from zero.
- INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
Examples
Normal values and NULL behavior
Decimal multiplication
Last modified on October 15, 2026