Using FORMAT for Input - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.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, Teradata Database assigns default values for the year (current year), month (current month), and day (first day), if not specified.