16.20 - Pack Example: Nondefault Options - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ - NewSQL Engine Analytic Functions

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
July 2019
Content Type
Programming Reference
Publication ID
B035-1206-162K
Language
English (United States)

This example specifies the pipe character (|) for Delimiter and 'false' for IncludeColumnName.

SQL Call

SELECT * FROM Pack (
  ON ville_temperature
  USING
  Delimiter ('|')
  OutputColumn ('packed_data')
  IncludeColumnName ('false')
  TargetColumns ('city', 'state', 'period', 'temp_f')
) AS dt ORDER BY 2;

Output

Virtual columns are separated by pipe characters and not labeled with their column names.

packed_data sn
Nashville|Tennessee|2010-01-01 00:00:00|35.1 1
Nashville|Tennessee|2010-01-01 01:00:00|36.2 2
Nashville|Tennessee|2010-01-01 02:00:00|34.5 3
Nashville|Tennessee|2010-01-01 03:00:00|33.6 4
Nashville|Tennessee|2010-01-01 04:00:00|33.1 5
Knoxville|Tennessee|2010-01-01 03:00:00|33.2 6
Knoxville|Tennessee|2010-01-01 04:00:00|32.8 7
Knoxville|Tennessee|2010-01-01 05:00:00|32.4 8
Knoxville|Tennessee|2010-01-01 06:00:00|32.2 9
Knoxville|Tennessee|2010-01-01 07:00:00|32.4 10