Example: Creating a Compressed TIME Column - Analytics Database - Teradata Vantage

SQL Operators and User-Defined Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
xub1628111590556.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
drp1544241916620
lifecycle
latest
Product Category
Teradata Vantage™

The following SQL statement creates a TIME column in t_time that is compressed when stored and uncompressed when retrieved from storage:

CREATE table t_time(i int, j time(6) compress using td_sysfnlib.ts_compress decompress using td_sysfnlib.ts_decompress);

If you insert the following TIME values into column j:

INSERT into t_time(1, TIME'06:26:44.820000');
INSERT into t_time(2, TIME'10:26:44.820000');

The following SQL statement:

SELECT j from t_time;

returns the 2 uncompressed TIME values that were compressed when the values were inserted in the table t_time.