3. Understanding SQL Data Types : Literals : Numeric Literals : Integer Literals
 
Share this page                  
Integer Literals
Integer literals are specified by a sequence of digits and an optional sign, in the following format:
[+|-] digit {digit} [e digit]
Integer literals are represented internally as an integer, smallint, or bigint depending on the value of the literal. A literal in the range -32,768 to +32,767 is represented as a smallint. A literal in the range ‑2,147,483,648 to +2,147,483,647 but outside the range of a smallint is represented as an integer. A literal in the range ‑9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 is represented as a bigint. Values that exceed the range of integers are represented as decimals.
You can specify integers using a simplified scientific notation, similar to the way floating point values are specified. To specify an exponent, follow the integer value with the letter, e, and the value of the exponent. This notation is useful for specifying large values. For example, to specify 100,000 use the exponential notation as follows:
1e5