📅  最后修改于: 2021-01-11 11:14:35             🧑  作者: Mango
表中的每一列都与一种数据类型相关联。数据类型指定将在列中存储哪种类型的值。每个数据值都属于SQL数据类型。
Teradata数据库支持以下类别的数据类型。有关受支持的数据类型的完整列表以及有关每种数据类型的详细信息,请参见下表,例如:
Data Type | Description | Data Type Examples |
---|---|---|
Array | An Array data type is used to store and access the multidimensional data. It can store many values of the same specific data type in a sequential or matrix-like format. |
|
Byte | Byte data types store raw data as logical bitstreams. These data types are stored in the client system format.
Teradata Database does not translate these data types. The data is transmitted directly from the memory of the client system. |
|
Character | Character data types represent characters that belong to a given character set. |
|
Dataset | A complex data type that represents self-describing data stored in a format conforming to some schema. | AVRO |
DateTime | DateTime data types represent a date, time, and timestamp values. |
|
Geospatial | Geospatial data types represent geographic information and provide a way for applications that manage, analyze, and display geographic information to interface with Teradata Database. |
|
Interval | Interval data types represent a period. For example, an Interval value can represent a period that includes several years, months, days, hours, minutes, or seconds. |
|
JSON | The JSON data type represents that data which are in JavaScript Object Notation format. | JSON |
Numeric | Numeric data types represent a numeric value that is an exact numeric number such as integer or decimal or an approximate numeric number such as floating-point. |
|
Parameter | Parameter data types are used only with input or result parameters in a function, method, stored procedure, or external stored procedure. |
|
Period | A Period data type represents a time period, where a period is a set of contiguous time granules that extends from a beginning bound up to but not including an ending bound. |
|
UDT | UDT (User-Defined Type) data types are custom data types that are defined to model the structure and behavior of the data used by the applications. |
|
XML | The XML data type represents XML content. The data is stored in a compact binary form that preserves the XML document’s information set, including the hierarchy information and type information derived from XML validation. | XML |
Teradata数据库支持以下核心数据类型属性,例如:
Data Type Attribute | Description |
---|---|
Not Null | It means the fields of a column must contain a value; they cannot be null. |
Uppercase | It specifies the character data for a column is stored as uppercase. |
[NOT] Case-Specific | It specifies the case for character data comparisons and collations. |
Format | It controls the display of expressions, column data, and conversions between data types. |
Title | It defines a heading to display or print the different results from the column name, which is used by default. |
As | It assigns a temporary name to an expression. |
Named | Named is a Teradata extension to the ANSI standard. For ANSI compliance, use AS instead of Named. |
Default | It is a user-defined default value that inserts in the field when a value is not specified for a column in an INSERT statement. |
With Default | It is a system-defined default value that inserts in the field when a value is not specified for a column in an INSERT statement. |
With Time Zone | It is used with the TIME or TIMESTAMP data type to specify a TIME or TIMESTAMP value with displacement from UTC as defined for the system. |
Character Set | It specifies the server character set for a character column. |