Example: Dynamic Row Results Returned by Specifying Table Functions - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

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-10-04
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

The following example uses the extract_store_data table function to return dynamic row results in the store_data table:

     SELECT *
     FROM (TABLE(extract_store_data('…', 1000) 
     RETURNS store_data) AS store_sales;

The following equivalent examples use the sales_retrieve table function to return dynamic row results either by specifying the maximum number of output columns and their individual column names and data types or by specifying only the name of the table into which the converted rows are to be written.

     SELECT *
     FROM TABLE (sales_retrieve(9005)
     RETURNS (store    INTEGER, 
              item     INTEGER,
              quantity INTEGER)) AS s;

     SELECT *
     FROM TABLE (sales_retrieve(9005)
     RETURNS sales_table) AS s;