17.10 - Examples - 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)

Example: DECIMAL Data Type

Consider the number 256.78. Its type is DECIMAL (5,2) and its default format is expressed either as -(4).9(2) or the equivalent  ----.99

The default DECIMAL or NUMERIC display formats are described in Data Type Default Formats.

Example: Defining a Table Column as DECIMAL Type

In the following table definition, column Salary is assigned the type DECIMAL.

CREATE TABLE Salaries
  (Id CHAR(9)
  ,Salary DECIMAL(8,2) FORMAT 'ZZZ,ZZ9.99'
   CHECK (Salary BETWEEN 1.00 AND 999000.00) );