Example: Implicit Type Conversion during Assignment - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Consider the following tables:

CREATE TABLE T1
   (Fname VARCHAR(25)
   ,Fid   INTEGER
   ,Yrs   CHARACTER(2));
CREATE TABLE T2
   (Wname VARCHAR(25)
   ,Wid   INTEGER
   ,Age   SMALLINT);

In the following statement, Vantage implicitly converts the character string in T1.Yrs to a numeric value:

UPDATE T2 SET Age = T1.Yrs + 5;

This is not evident in the syntax of the source statement, but becomes evident when the dictionary information for tables T1 and T2 is accessed.