TO_INT
Description
TO_INT
converts STRING input to INT output. If the input does not represent an integer number (or the value of the representation is outside of the supported INT range), the function returns NULL.
Supported input column type: STRING. Use of the decimal separator or scientific E notation in input strings is not supported in TO_INT
, and will be mapped to NULL. Trailing and leading whitespaces will be automatically removed and the trimmed STRING
will be converted to an INT
.
Output column type: INT.
Syntax
TO_INT ( table.column )
Null handling
If the input value is NULL, the output value is NULL as well.
Example
[1] Convert strings to integers. Note the NULL output for the following STRING input:
| ||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||
|