17.10 - Example: NUMBER Data Type - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)

Consider the following table definition:

CREATE TABLE num_tab
  (n1 NUMBER(*,3),
   n2 NUMBER,
   n3 NUMBER(*),
   n4 NUMBER(5,1),
   n5 NUMBER(3) );

The following table shows the result of inserting various values into a column defined as NUMBER (3).

If you insert this value... the value of column n5 will be...
1.234 1
123.6789 124
1234.56 An error is returned since the inserted value exceeds the size of column n5.

The following table shows the result of inserting various values into a column defined as NUMBER (*,3).

If you insert this value... the value of column n1 will be...
1.234 1.234
1234.6789 1234.679