| Any data type conversion whether done implicitly, or done explicitly by
casting or conversion functions must obey the following rules.
When the target is an integer type (SMALLINT, INTEGER, BIGINT) The target must be large enough so that there is no loss of
digits to the left of the decimal point in the source value.
If the source value has decimal digits, the outcome depends
upon the individual case described previously.
If the source is a character data type, it must contain a
valid numeric literal.
When the target is a floating point type (REAL, DOUBLE PRECISION)
The value of the source is rounded to the number of digits
of precision of the target type (6 digits for REAL, 15 for DOUBLE PRECISION).
If the source is a character data type, it must contain a valid numeric literal.
When the target is the NUMERIC data type The target must be large enough so that there is no loss of
digits to the left of the decimal point in the source value.
The value of the source is rounded to the scale of the target type.
If the source is a character data type, it must contain a valid
numeric literal.
When the target is a character data type (CHAR, VARCHAR, TEXT)
When the target is a timestamp data type (DATE, TIMESTAMP)
| |
---|