All Products
Search
Document Center

PolarDB:Common data types

Last Updated:Mar 28, 2026

PolarDB for Oracle supports the following built-in general-purpose data types.

Numeric types

NameAliasDescription
INTEGERINT, BINARY INTEGER, PLS INTEGERSigned four-byte integer
NUMBERDEC, DECIMAL, NUMERICExact numeric with optional decimal places
NUMBER(p [, s])DEC(p [, s]), DECIMAL(p [, s]), NUMERIC(p [, s])Exact numeric of maximum precision p and optional scale s
DOUBLE PRECISIONFLOAT, FLOAT(25)-FLOAT(53)Double precision floating-point number
REALFLOAT(1)-FLOAT(24)Single precision floating-point number

Character types

NameAliasDescription
CHAR [(n)]CHARACTER [(n)]Fixed-length character string of n characters
VARCHAR2(n)CHAR VARYING(n), CHARACTER VARYING(n), VARCHAR(n)Variable-length character string with a maximum length of n characters
CLOBLONG, LONG VARCHARLong character string

Date and time types

NameAliasDescription
DATETIMESTAMP(0)Date and time to the second
TIMESTAMP [(p)]-Date and time with optional fractional second precision p
TIMESTAMP [(p)] WITH TIME ZONE-Date and time with optional fractional second precision p, and with time zone

Binary and other types

NameAliasDescription
BLOBLONG RAW, RAW(n), BYTEABinary data
BOOLEAN-Logical Boolean (true/false)
XMLTYPE-XML data

Usage notes

  • Oracle-originated names such as NUMBER, VARCHAR2, CLOB, BLOB, and XMLTYPE are the primary type names for PolarDB for Oracle. Use these names when writing new applications on PolarDB for Oracle or migrating from Oracle.

  • SQL standard aliases such as NUMERIC, CHARACTER VARYING, and DECIMAL are accepted interchangeably. Use these when portability to other SQL-standard databases is a requirement.

  • For NUMBER(p [, s]), p is the total number of significant digits (precision) and s is the number of digits to the right of the decimal point (scale).

  • DATE stores date and time to the second and is equivalent to TIMESTAMP(0). It differs from the SQL standard DATE type, which stores date only.