Integer Types

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

Synopsis

There are several different datatypes for integers of different value ranges. Integers can be set, inserted, incremented, and decremented.

DataTypeMinMax
SMALLINT-32,76832,767
INT or INTEGER-2,147,483,6482,147,483,647
BIGINT-9,223,372,036,854,775,8089,223,372,036,854,775,807

Syntax

The following keywords are used to specify a column of type integer for different constraints including its value ranges.

  1. type_specification ::= SMALLINT | INT | INTEGER | BIGINT
  2. integer_literal ::= [ + | - ] digit [ { digit | , } ... ]

Semantics

  • Columns of type SMALLINT, INT, INTEGER, or BIGINT can be part of the PRIMARY KEY.
  • Values of different integer datatypes are comparable and convertible to one another.
  • Values of integer datatypes are convertible but not comparable to floating point number.
  • Currently, values of floating point datatypes are not convertible to integers. This restrictionwill be removed in the near future.

See Also

Data Types