Pack Function Example | Teradata Vantage - Example: Nondefault Options - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-06
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢

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

Pack with Nondefault Options 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;

Pack with Nondefault Options Output

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

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