BIGINT scalar function
The BIGINT function returns a big integer representation of either a number or a character or graphic string representation of a number.
Numeric to Big Integer:
String to Big Integer:
The schema is SYSIBM.
Numeric to Big Integer
- numeric-expression
- An expression that returns a value of any built-in numeric data
type.
The result is the same number that would occur if the argument were assigned to a big integer column or variable. If the whole part of the argument is not within the range of big integers, an error is returned. The fractional part of the argument is truncated.
String to Big Integer
- string-expression
- An expression that returns a value of a character or graphic string (except a CLOB and DBCLOB)
with a length attribute that is not greater than 255 bytes. The string must contain a valid string
representation of a number.
The result is the same number that would result from
CAST(string-expression AS BIGINT)
. Leading and trailing blanks are eliminated and the resulting string must conform to the rules for forming an integer constant. If the whole part of the argument is not within the range of big integers, an error is returned.
The result of the function is a big integer.
The result can be null; if the argument is null, the result is the null value.
To increase the portability of applications, use the CAST specification.
SELECT BIGINT(12345.6)
FROM SYSIBM.SYSDUMMY1;
SELECT BIGINT('00123456789012')
FROM SYSIBM.SYSDUMMY1;