15.00 - Storing NUMBER Data - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Storing NUMBER Data

You can achieve optimal space savings for NUMBER data using either multi-value compression, algorithmic compression, or a combination of both.

NUMBER data is stored as a variable length field from 0 to 18 bytes in width. You can use the NUMBER type to represent both fixed point and floating point decimal numbers, depending on the syntax you use to specify the type. In the following table, the characters p and s represent precision and scale, respectively.

 

      General Type

         Syntax

                             Functional Description

Fixed point

 

NUMBER(p,s)

Similar to DECIMAL(p,s)

NUMBER(p)

Similar to DECIMAL(p)

Floating point

 

 

NUMBER(*,s)

Floating point decimal with s fractional digits

NUMBER

A floating point number

NUMBER(*)

Same as NUMBER

The following table highlights the approximate equivalences/valid substitutions between the fixed and floating point NUMBER types with other exact (fixed point) and approximate (floating point) types.

 

You can use this NUMBER type …

Anywhere you can use this data type …

With a maximum precision of this many digits …

Fixed point

  • DECIMAL
  • NUMERIC
  • 38

    Floating point

  • FLOAT
  • REAL
  • DOUBLE PRECISION
  • 40

    Whether a NUMBER type is used to represent a fixed point value or a floating point value, it is stored in the same way and with the same accuracy. See “Floating Point NUMBER Types” on page 825, “Non‑INTEGER Numeric Data Types” on page 826, and SQL Data Types and Literals for more information about the NUMBER type.