Summary of Data Types that TDV Supports

The following table discusses special considerations when using data types with TDV. Where more detailed discussion is required, separate sections are cross-referenced from the Special Notes column of the table.

Data Types

Variants Supported

Special Notes

BINARY

BINARY, VARBINARY

Behaves in a manner similar to STRING, but it is right-padded with zeroes rather than spaces.
Minimum length is 1.
Maximum length is 255.
BINARY or VARBINARY with length >255 is a BLOB.

BIT

 

 

BLOB

BLOB

You can project (SELECT) BLOB columns.
You can use BLOB only in the CAST function.

BOOLEAN

DATETIME

For more information, see BOOLEAN.

CLOB

CLOB

You can project (SELECT) CLOB columns.
You can use CLOB only in the CAST function.

DATE

DATETIME

Month, day, year.

DECIMAL

DECIMAL, NUMERIC

  • TDV DECIMAL has a default precision/scale of 32/2. TDV Numeric has a default precision/scale of 32/0.

  • An error is thrown if the number of digits to the left of the decimal point exceeds the precision specified for the type. For example, 12345.00 exceeds the limits of DECIMAL(4,2) and so throws an error.

  • Its scale (the digits to the right of the decimal point) is rounded if necessary to match the scale of the type designation. For example, 1.425 is rounded to 1.43 for DECIMAL(4,2).

  • DECIMAL and NUMERIC data types are zero-padded on the right if the number of digits to the right of the decimal point is smaller than the scale of the type designation. For example, 1.425 becomes 1.42500 for DECIMAL(4,5).

  • NUMERIC and DECIMAL declaration without specifying precision and scale will result in an arbitrary value. This is not ANSI defined behavior. Refer to the User Guide section TDV Configuration Parameters Common to Multiple Datasources for details about changing the Arbitrary Numeric property.

DOUBLE

 

 

FLOAT

 

 

INTEGER

TINYINT, SMALLINT, INTEGER, BIGINT

A runtime error is thrown if a value is out of the valid range for the integer type.

INTERVAL DAY

 

Represents a duration of time.
Intervals can be positive or negative.
Not directly compatible with INTERVAL MONTH and INTERVAL YEAR.
Can be used in arithmetic operations (addition, subtraction, division, and multiplication), and functions such as ABS, CAST, and EXTRACT.
For more information, see INTERVAL DAY.

INTERVAL MONTH

 

Represents a duration of time.
Can be positive or negative.
Not directly compatible with INTERVAL DAY and INTERVAL YEAR.
Can be used in arithmetic operations (addition, subtraction, division, and multiplication), and functions such as ABS, CAST, and EXTRACT.

INTERVAL YEAR

 

Represents a duration of time.
Intervals can be positive or negative.
Not directly compatible with INTERVAL DAY and INTERVAL MONTH.
Can be used in arithmetic operations (addition, subtraction, division, and multiplication), and functions such as ABS, CAST, and EXTRACT.
For more information, see INTERVAL YEAR.

LONGVARCHAR

 

 

NUMBER

NUMBER (p, s)

p is precision. s is scale.

Precision and scale are optional. When provided, NUMBER is the same as DECIMAL/NUMERIC.

REAL

 

 

STRING

CHAR, VARCHAR

Minimum length is 1.
If a CHAR is less than minimum length, it is right-padded with spaces.
Maximum length is 255.
CHAR or VARCHAR with length >255 is a CLOB.
Operations might pad a CHAR, even if it was not padded originally. So CONCAT (char10, char10) might return "A         B         " instead of "AB" as the result.

TIME

TIMESTAMP

Hours, minutes, seconds.

TIMESTAMP

 

Month, day, year and hours, minutes, seconds.
Depending on formatting, may contain fractional seconds.

XML

 

TDV support for the XML data type complies with the ANSI INCIT/ISO/IEC 9075 part 14 XML-related specifications.
For more information, see XML.