Syntax - 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ā„¢
{ COMPRESS [ constant | ( { constant | NULL } [,...] ) ] |
  COMPRESS_USING_phrase DECOMPRESS_USING_phrase
} [...]
The order of COMPRESS_USING_phrase and DECOMPRESS_USING_phrase is not important.

Syntax Elements

COMPRESS_USING_phrase
COMPRESS USING [dbname.] compress_udf
DECOMPRESS_USING_phrase
DECOMPRESS USING [dbname.] decompress_udf

COMPRESS With No Arguments

Compress nulls only.

Note that if you do not specify COMPRESS, nulls are not automatically compressed.

Multivalue Compression (MVC) Specification

COMPRESS
Compress column data using multivalue compression.
constant
A set of values to be compressed.
You can specify a single constant value, or a multivalued, comma-separated list of up to 255 distinct constant values enclosed in parentheses.
NULL
Nulls will be compressed.
NULL can be specified alone, but it must be enclosed in parentheses. This is the same as specifying COMPRESS without an argument.
NULL can be specified with up to 255 constant values in a multivalued, comma-separated list enclosed in parentheses.

Algorithmic Compression (ALC) Specification

COMPRESS USING
Compress column data using algorithmic compression.
DECOMPRESS USING
Decompress column data that was previously compressed using algorithmic compression.
dbname
The name of the database in which the compress or decompress user-defined function (UDF) is stored. If a database name is not specified, the default database used is SYSUDTLIB.
You should create all compress and decompress UDFs in the SYSUDTLIB database. Note that compression functions supplied by Teradata are located in TD_SYSFNLIB.
compress_udf
The name of the UDF used to compress values in the column.
decompress_udf
The name of the UDF used to decompress values in the column.