Data Types on Which Implicit Conversion is Performed - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantage™

If operand data types differ, Vantage performs an implicit conversion according to the following table. Implicit conversions are Teradata extensions to the ANSI SQL:2011 standard.

Comparisons between character and numeric data types require that the character field be convertible to a numeric value.

IF one expression operand is … AND the other expression operand is … THEN Vantage compares the data as …
Character Character Character.

For more details, see Character String Comparisons.

Date Date.

Vantage returns an error for character data with GRAPHIC server character set.

BYTEINT

SMALLINT

INTEGER

FLOAT

FLOAT.

Vantage returns an error for character data with GRAPHIC server character set.

Period Period.
CHAR(k)

VARCHAR(k))

WHERE k <= 16

BIGINT

DECIMAL(m,n)

FLOAT.

Vantage returns an error for character data with GRAPHIC server character set.

CHAR(k)

VARCHAR(k)

where k > 16

DECIMAL(m,n)

where m <= 16

FLOAT.

Vantage returns an error for character data with GRAPHIC server character set.

BIGINT

DECIMAL(m,n)

where m> 16

Vantage returns an error.
CHAR(k)

VARCHAR(k)

NUMBER and k<=16 FLOAT.

Vantage returns an error for character data with GRAPHIC server character set.

NUMBER and k> 16 Vantage returns an error.
BYTEINT SMALLINT SMALLINT.
BYTEINT

SMALLINT

INTEGER INTEGER.
BYTEINT

SMALLINT

INTEGER

BIGINT

BIGINT BIGINT.
BYTEINT DECIMAL(m,n)

where m <= 18 and m-n >= 3

DECIMAL(18,n).
SMALLINT DECIMAL(m,n)

where m <= 18 and m-n >= 5

INTEGER DECIMAL(m,n)

where m <= 18 and m-n >= 10

DATE
BYTEINT DECIMAL(m,n)

where m > 18 or m-n < 3

DECIMAL(38,n).
SMALLINT DECIMAL(m,n)

where m > 18 or m-n < 5

INTEGER DECIMAL(m,n)

where m > 18 or m-n < 10

DATE
BIGINT DECIMAL(m,n)
DECIMAL(m,n) DECIMAL(k,j)

where max(m-n,k-j) + max(j,n) <= 18

DECIMAL(18,max(j,n)).
DECIMAL(k,j)

where max(m-n,k-j) + max(j,n) > 18

DECIMAL(38,max(j,n)).
BYTEINT

SMALLINT

INTEGER

BIGINT

DECIMAL(m,n)

NUMBER(m,n)

NUMBER(m)

NUMBER(*,n)

NUMBER

NUMBER(k,j)

NUMBER(k)

NUMBER(*,j)

NUMBER

NUMBER
DATE BYTEINT

SMALLINT

INTEGER

INTEGER.
BIGINT BIGINT.
FLOAT FLOAT.
FLOAT BYTEINT

SMALLINT

INTEGER

BIGINT

DECIMAL(m,n)

NUMBER(m,n)

NUMBER(m)

NUMBER(*,n)

NUMBER

FLOAT.
Period Character Period.