Syntax - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
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.
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.