Data Types on Which Implicit Conversion is Performed - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
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.