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

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1145-171K
Language
English (United States)

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.