BIGINT

The BIGINT function returns a big integer representation.

Numeric to Big Integer

Read syntax diagramSkip visual syntax diagramBIGINT(numeric-expression)

String to Big Integer

Read syntax diagramSkip visual syntax diagramBIGINT(string-expression)

Datetime to Big Integer

Read syntax diagramSkip visual syntax diagramBIGINT(datetime-expression)

The BIGINT function returns a big integer representation of:

  • A number
  • A character or graphic string representation of a decimal number
  • A character or graphic string representation of an integer
  • A character or graphic string representation of a floating-point number
  • A character or graphic string representation of a decimal floating-point number
  • A date
  • A time
  • A timestamp

Numeric to Big Integer

numeric-expression
An expression that returns a numeric 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 that is a character-string or graphic-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 a floating-point, decimal floating-point, integer, or decimal constant. If the whole part of the argument is not within the range of big integers, an error is returned. Any fractional part of the argument is truncated.

Datetime to Big Integer

datetime-expression
An expression that is 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.

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.

Note

Syntax alternatives: The CAST specification should be used to increase the portability of applications. For more information, see CAST specification.

Example

  • Using the EMPLOYEE table, select the SALARY column in big integer form for further processing in the application.
      SELECT BIGINT(SALARY)
        FROM EMPLOYEE