Result Data Type - 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

The following table shows the result data type for binary arithmetic operators.

For details on the result data type for binary arithmetic operations involving DateTime and Interval types, see Arithmetic, Trigonometric, Hyperbolic Operators/Functions.

Left Operand Right Operand Operator Result Data Type
Any data type Any data type ** FLOAT
DATE BYTEINT

SMALLINT

INTEGER

BIGINT

+ - DATE

If the value of a date result is not in the range of values allowed for the DATE type, an error is reported. The range is any date on the Gregorian calendar from year 1 to year 9999.

BYTEINT

SMALLINT

INTEGER

* / MOD INTEGER

These operations on DATE do not report an error, but results are rarely meaningful.

BIGINT * / MOD BIGINT

These operations on DATE do not report an error, but results are rarely meaningful.

DECIMAL(k,j) + - DATE

These operations on DATE do not report an error, but results are rarely meaningful.

Fractions of decimal values are truncated when added to or subtracted from date values.

If the value of a date result is not in the range of values allowed for the DATE type, an error is reported. The range is any date on the Gregorian calendar from year 1 to year 9999.

* / MOD DECIMAL(p,j)

These operations on DATE do not report an error, but results are rarely meaningful.

For details about the value of p, see DECIMAL Result Data Type.

NUMBER(k,j)

NUMBER(k)

NUMBER(*,j)

NUMBER

+ - DATE

These operations on DATE do not report an error, but results are rarely meaningful.

Fractions of decimal values are truncated when added to or subtracted from date values.

If the value of a date result is not in the range of values allowed for the DATE type, an error is reported. The range is any date on the Gregorian calendar from year 1 to year 9999.

* / MOD NUMBER
FLOAT * / + - MOD FLOAT
DATE - INTEGER

The difference between two dates is the number of days between those dates. This is not the numeric difference between the values.

+ * / MOD INTEGER

These operations on DATE do not report an error, but results are rarely meaningful.

CHAR(n)

VARCHAR(n)

* / + - MOD FLOAT

These operations on DATE do not report an error, but results are rarely meaningful.

If an argument of an arithmetic operator is a character string, the first action is to attempt to convert the character string to a floating value. If this conversion fails, an error is reported.

BYTEINT

SMALLINT

INTEGER

BYTEINT

SMALLINT

INTEGER

* / + - MOD INTEGER
BIGINT * / + - MOD BIGINT
DECIMAL(k,j) * / + - MOD DECIMAL(p,j)

For details about the value of p, see DECIMAL Result Data Type.

NUMBER(k,j)

NUMBER(k)

NUMBER(*,j)

NUMBER

* / + - MOD NUMBER
FLOAT * / + - MOD FLOAT
CHAR(n)

VARCHAR(n)

* / + - MOD FLOAT

If an argument of an arithmetic operator is a character string, the first action is to attempt to convert the character string to a floating value. If this conversion fails, an error is reported.

DATE + DATE

If the value of a date result is not in the range of values allowed for the DATE type, an error is reported. The range is any date on the Gregorian calendar from year 1 to year 9999.

- error
* / MOD INTEGER

These operations on DATE do not report an error, but results are rarely meaningful.

BIGINT BYTEINT

SMALLINT

INTEGER

BIGINT

* / + - MOD BIGINT
DECIMAL(k,j) * / + - MOD DECIMAL(p,j)

For details about the value of p, see DECIMAL Result Data Type.

NUMBER(k,j)

NUMBER(k)

NUMBER(*,j)

NUMBER

* / + - MOD NUMBER
FLOAT * / + - MOD FLOAT
CHAR(n)

VARCHAR(n)

* / + - MOD FLOAT

If an argument of an arithmetic operator is a character string, the first action is to attempt to convert the character string to a floating value. If this conversion fails, an error is reported.

DATE + DATE

If the value of a date result is not in the range of values allowed for the DATE type, an error is reported. The range is any date on the Gregorian calendar from year 1 to year 9999.

- error
* / MOD BIGINT

These operations on DATE do not report an error, but results are rarely meaningful.

DECIMAL(m,n) BYTEINT

SMALLINT

INTEGER

BIGINT

+ - * DECIMAL(p,n)

For details about the value of p, see DECIMAL Result Data Type.

/ MOD DECIMAL(m,n)
DECIMAL(k, j) + - DECIMAL(min(p,(1+max(n,j)+max(m -n,k-j))),max(n,j))

For details about the value of p, see DECIMAL Result Data Type.

* DECIMAL(min(p,m +k),(n+j))

For details about the value of p, see DECIMAL Result Data Type.

/ MOD DECIMAL(p,max(n,j))

For details about the value of p, see DECIMAL Result Data Type.

NUMBER(k,j)

NUMBER(k)

NUMBER(*,j)

NUMBER

* / + - MOD NUMBER
FLOAT * / + - MOD FLOAT
CHAR(n)

VARCHAR(n)

* / + - MOD FLOAT

If an argument of an arithmetic operator is a character string, the first action is to attempt to convert the character string to a floating value. If this conversion fails, an error is reported.

DATE + DATE

Fractions of decimal values are truncated when added to or subtracted from date values.

If the value of a date result is not in the range of values allowed for the DATE type, an error is reported. The range is any date on the Gregorian calendar from year 1 to year 9999.

- error
* DECIMAL(p,n)

These operations on DATE do not report an error, but results are rarely meaningful.

For details about the value of p, see DECIMAL Result Data Type.

/ MOD DECIMAL(m,n)

These operations on DATE do not report an error, but results are rarely meaningful.

NUMBER(m,n)

NUMBER(m)

NUMBER(*,n)

NUMBER

BYTEINT

SMALLINT

INTEGER

BIGINT

* / + - MOD NUMBER
DECIMAL(k,j)
FLOAT * / + - MOD FLOAT
CHAR(n)

VARCHAR(n)

FLOAT

If an argument of an arithmetic operator is a character string, the first action is to attempt to convert the character string to a floating value. If this conversion fails, an error is reported.

DATE + DATE

Fractions of decimal values are truncated when added to or subtracted from date values.

If the value of a date result is not in the range of values allowed for the DATE type, an error is reported. The range is any date on the Gregorian calendar from year 1 to year 9999.

- error
* NUMBER

These operations on DATE do not report an error, but results are rarely meaningful.

/ MOD NUMBER

These operations on DATE do not report an error, but results are rarely meaningful.

NUMBER(k,j)

NUMBER(k)

NUMBER(*,j)

NUMBER

* / + - MOD NUMBER
FLOAT BYTEINT

SMALLINT

INTEGER

BIGINT

DECIMAL(k,j)

NUMBER(k,j)

NUMBER(k)

NUMBER(*,j)

NUMBER

FLOAT

* / + - MOD FLOAT
DATE * / + - MOD FLOAT

These operations on DATE do not report an error, but results are rarely meaningful.

CHAR(n)

VARCHAR(n)

* / + - MOD FLOAT

If an argument of an arithmetic operator is a character string, the first action is to attempt to convert the character string to a floating value. If this conversion fails, an error is reported.

CHAR(n)

VARCHAR(n)

BYTEINT

SMALLINT

INTEGER

BIGINT

DECIMAL(k,j)

NUMBER(k,j)

NUMBER(k)

NUMBER(*,j)

NUMBER

FLOAT

CHAR(n)

VARCHAR(n)

* / + - MOD FLOAT

If an argument of an arithmetic operator is a character string, the first action is to attempt to convert the character string to a floating value. If this conversion fails, an error is reported.

DATE * / + - MOD FLOAT

These operations on DATE do not report an error, but results are rarely meaningful.

If an argument of an arithmetic operator is a character string, the first action is to attempt to convert the character string to a floating value. If this conversion fails, an error is reported.