Using FORMAT for Input - 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™

FORMAT can also be used for input.

For example, the following statement creates a table table_2 with two date type columns:

CREATE Table_2
  (f1 DATE FORMAT 'YY年MM月DD日',
   f2 DATE FORMAT '和暦YY年MM月DD日');

The following SQL statement is valid:

INSERT INTO Table_2 ('92年03月10日', '平成04年03月10日');

Each Imperial Era (except the current one) has an end, which is considered in the validation of input. Using Japanese Imperial Era formatting for dates previous to the Meiji era (before 1867/1/9) is considered a run-time error.

Normally on input, Vantage assigns default values for the year (current year), month (current month), and day (first day), if not specified.