Example: Implicit Conversion of Character to Numeric - 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ā„¢

The INSERT statement in the following example implicitly converts the character data type to the target numeric data type:

CREATE TABLE t1 
(f1 DECIMAL(10,2) FORMAT 'G-U(9)D9(2)');
   
INSERT t1 ('USD12,345,678.90');

If a column definition in a CREATE TABLE statement does not specify a FORMAT phrase for the data type, the column uses the corresponding data type default format as defined in the specification for data formatting (SDF) file.