17.10 - Examples - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)

Example: VARCHAR Data Type

The following statement creates a table that defines two VARCHAR columns: InfoKey and InfoData.

CREATE TABLE InfoTable
  (InfoKey VARCHAR(10) NOT NULL
  ,InfoData VARCHAR(16384) )
UNIQUE PRIMARY INDEX ( InfoKey );

The following statements insert character data of varying lengths into the InfoKey and InfoData columns:

INSERT INTO InfoTable ('001_5_799', 'Data for key 001_5_799');
INSERT INTO InfoTable ('2', 'Data for key 2');

Example: LONG VARCHAR Data Type

The following statement creates a table that defines a LONG VARCHAR column called InfoData.

CREATE TABLE InfoTable (InfoData LONG VARCHAR);