17.10 - Using FORMAT in CREATE TABLE - 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)

When the FORMAT phrase is used in the CREATE TABLE statement, as follows:

CREATE TABLE Test1 (Col1 DECIMAL(4) FORMAT '9999S'); 

then zoned input character strings can be loaded with standard INSERT statements, whether the data is defined:

INSERT INTO Test1 (Col1) VALUES ('123J'); 

or read from a client system data record via the USING modifier:

USING Ext1 (CHAR(4)) 
INSERT INTO Test1 (Col1)
VALUES (:Ext1); 

The data record contains the string ‘123J’.

Subsequently, a simple select, such as:

SELECT Col1 FROM Test1;

returns:

Col1
----
  
123J