15.00 - Non-INTEGER Numeric Data Types - Teradata Database

Teradata Database Design

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

Non‑INTEGER Numeric Data Types

The following table indicates the alignment requirements for each of the non‑true integer numeric data types and their respective sizes on platforms that use packed64 versus aligned row storage formats:

 

           Data Type

 

                   Range of n

 

  Packed64 Size (bytes)

          Aligned Row
           Size (bytes)

Allocated Size for
   Aligned Row
 Format (bytes)

DECIMAL(n)
NUMERIC(n)

                 1   n    2

         1

                 1

               1

                 3   n     4

         2

                 2

               2

                 5   n     9

         4

                 4

               4

               10   n     18

         8

                 8

               8

               19   n     38

         

                 4

Alignment is 4 because decimal numbers in this range are stored internally as four 32‑bit integers on all systems.

             16

NUMBER(n)
NUMBER(n,s)

                0   n     38

                       and 0

     0 - 18

              0 - 18

           0 - 18

FLOAT
REAL
DOUBLE PRECISION

                 Not applicable

         8

                 8

               8

NUMBER
NUMBER(*)
NUMBER(*,
s)

                 Not applicable

     0 - 18

              0 - 18

           0 - 18

 

FLOAT/REAL/DOUBLE PRECISION: 8 Bytes (All Platforms)

    Bit 0

 

                          Bits 1 - 10

                          Bits 11 - 63

                          Exponent

                            Mantissa

Sign

2 * 10-307 — 2 * 10308

 

NUMBER: 0- 18 Bytes (All Platforms)

 Byte 0

                                                                     Bytes 1 - 17

Exponent

Mantissa

 

DECIMAL/NUMERIC [(n[,m])]: 1, 2, 4, 8, or 16 Bytes (All Platforms)

1 - 2 digits

Not used

 

3 - 4 digits

Not used

5 - 9 digits

Not used

10 - 18 digits

Not used

19-38 digits

    Byte
       1

  Byte
    2

  Byte
    3

  Byte
    4

  Byte
    5

  Byte
    6

  Byte
    7

  Byte
    8

  Byte
    9

  Byte    10

  Byte    11

  Byte    12

  Byte    13

  Byte    14

  Byte    15

  Byte    16

-99 — 99

Not used

-9999 — 9999

Not used

-999999999 — 999999999

Not used

-999999999999999999 — 999999999999999999

Not used

-99999999999999999999999999999999999999 — 99999999999999999999999999999999999999