BIGINT scalar function
The BIGINT function returns a big integer (a binary integer with a precision of 63 bits) representation of a value of a different data type.
Numeric to BIGINT
String to BIGINT
Datetime to BIGINT
Boolean to BIGINT
The schema is SYSIBM.
 Numeric to BIGINT

 numericexpression
 An expression that returns a value of any builtin numeric data
type.
The result is the same number that would occur if the argument were assigned to a big integer column or variable. The fractional part of the argument is truncated. If the whole part of the argument is not within the range of big integers, an error is returned (SQLSTATE 22003).
 String to BIGINT

 stringexpression
 An expression that returns a value that is a characterstring or Unicode
graphicstring representation of a number with a length not greater than the maximum length of
a character constant.
The result is the same number that would result from CAST(stringexpresssion AS BIGINT). Leading and trailing blanks are eliminated and the resulting string must conform to the rules for forming an integer, decimal, floatingpoint, or decimal floatingpoint constant (SQLSTATE 22018). If the whole part of the argument is not within the range of big integers, an error is returned (SQLSTATE 22003). The data type of stringexpresssion must not be CLOB or DBCLOB (SQLSTATE 42884).
 Datetime to BIGINT

 datetimeexpression
 An expression that is of one of the following data types:
 DATE. The result is a BIGINT value representing the date as yyyymmdd.
 TIME. The result is a BIGINT value representing the time as hhmmss.
 TIMESTAMP. The result is a BIGINT value representing the timestamp as yyyymmddhhmmss. The fractional seconds portion of the timestamp value is not included in the result.
 Boolean to BIGINT

 booleanexpression
 An expression that returns a Boolean value (TRUE or FALSE). The result is either 1 (for TRUE) or 0 (for FALSE).
Result
The result of the function is a big integer. If the argument can be null, the result can be null; if the argument is null, the result is the null value.
Notes
 Increasing portability of applications: If the first argument is numeric, or if the first argument is a string and the length argument is specified, use the CAST specification instead of this function to increase the portability of your applications.
Examples
 Example 1: From ORDERS_HISTORY table, count the number
of orders and return the result as a big integer value.
SELECT BIGINT (COUNT_BIG(*)) FROM ORDERS_HISTORY
 Example 2: Using the EMPLOYEE table, select the EMPNO column
in big integer form for further processing in the application.
SELECT BIGINT (EMPNO) FROM EMPLOYEE
 Example 3: Assume that the column RECEIVED (whose data
type is TIMESTAMP) has an internal value equivalent to '1988122214.07.21.136421'.
results in the valueBIGINT(RECEIVED)
19 881 222 140 721
.  Example 4: Assume that the column STARTTIME (whose data
type is TIME) has an internal value equivalent to '12:03:04'.
results in the valueBIGINT(STARTTIME)
120 304
.  Example 5: The following
statement returns the value 1 of data type
BIGINT.
values BIGINT(TRUE)
 Example 6: The following
statement returns the value 0 of data type
BIGINT.
values BIGINT(3>3)