VARCHAR Data Type | Data Types and Literals | Teradata Vantage - VARCHAR Data Type - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantage™

Represents a variable length character string of length 0 to n for internal character storage. LONG VARCHAR specifies the longest permissible variable length character string for internal character storage.

ANSI Compliance

VARCHAR is ANSI SQL:2011 compliant.

LONG VARCHAR, VARGRAPHIC, and LONG VARGRAPHIC are Teradata extensions to the ANSI SQL:2011 standard.

Syntax

{
  { VARCHAR | { CHARACTER | CHAR } VARYING } ( n )
    [ { CHARACTER | CHAR } SET ] server_character_set |

  LONG VARCHAR |
  
  VARGRAPHIC ( n ) |
  
  LONG VARGRAPHIC

} [ attributes [...] ]

Syntax Elements

n
The maximum number of characters or bytes allotted to the column defined with this server character set:
  • For the LATIN server character set, the maximum value for n is 64000 characters.
  • For the UNICODE and GRAPHIC server character sets, the maximum value for n is 32000 characters.
  • For the KANJISJIS server character set, the maximum value for n is 32000 bytes.
server_character_set
The server character set for the character column being defined.
If the CHARACTER SET server_character_set clause is omitted, the default server character set depends on how the user is defined in the DEFAULT CHARACTER SET clause of the CREATE USER statement. See Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
In accordance with Teradata internationalization plans, KANJI1 support is deprecated and is to be discontinued in the near future. KANJI1 is not allowed as a default character set; the system changes the KANJI1 default character set to the UNICODE character set. Creation of new KANJI1 objects is highly restricted. Although many KANJI1 queries and applications may continue to operate, sites using KANJI1 should convert to another character set as soon as possible.
Supported values for server_character_set are as follows:
attributes
Appropriate data type, column storage, or column constraint attributes.
See Core Data Type Attributes and Storage and Constraint Attributes for specific information.