16.20 - INTERVAL MINUTE Data Type - Teradata Vantage NewSQL Engine

Teradata Vantage™ Data Types and Literals

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

Purpose

Identifies a field as an INTERVAL value defining a period of time in minutes.

Syntax



precision
The permitted range of digits for MINUTE, ranging from one to four.
The default is two.
attributes
Appropriate data type, column storage, or column constraint attributes.
For specific information, see Core Data Type Attributes and Storage and Constraint Attributes.

ANSI Compliance

INTERVAL MINUTE is ANSI SQL:2011 compliant.

Internal Representation of INTERVAL MINUTE

Storage Format Total Length
SMALLINT 2 bytes

External Representation of INTERVAL MINUTE

INTERVAL MINUTE types are imported and exported in record and indicator modes as CHARACTER data using the client character set.

Type Format
CHARACTER(precision + 1) '-m(precision)'

For example, for INTERVAL MINUTE(2), the value might be something like '  49 '.

Range of Values

The range of values for INTERVAL MINUTE is as follows.

Type and Precision Minimum Value Maximum Value
INTERVAL MINUTE(1) -'9' '9'
INTERVAL MINUTE(2) -'99' '99'
INTERVAL MINUTE(3) -'999' '999'
INTERVAL MINUTE(4) -'9999' '9999'
Decimal values are not allowed for Interval data types except for second intervals.

Implicit and Explicit INTERVAL MINUTE Conversion

Teradata Database performs implicit conversion from one Interval data type to another Interval type in some cases. You can also use CAST to explicitly convert one Interval type to another.

Conversions are possible only within the same INTERVAL family. For example, you may convert a YEAR interval to months, but not to days or hours.

For more information, see “Data Type Conversions” in Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.

Example: INTERVAL MINUTE Data Type

The following statement creates a table with an INTERVAL MINUTE column:

CREATE TABLE TimeInfo
  (Id INTEGER
  ,Offset INTERVAL MINUTE (4));
 
INSERT TimeInfo (1001, INTERVAL '2400' MINUTE);