Using FORMAT in CREATE TABLE - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
tpf1598412463935.ditamap
dita:ditavalPath
tpf1598412463935.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantage™

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