Example Query - Analytics Database - Teradata Vantage

SQL External Routine Programming

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
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

Here is an example of how to invoke the table function with constant expression input arguments and get a result row with four columns:

SELECT *
FROM TABLE (get_data('1356,122,20061009,abc')
RETURNS (col1 INTEGER, col2 BYTEINT, col3 DATE, col4 VARCHAR(5)))
AS t1;

Here is another example of how to invoke the table function with constant expression input arguments and get a result row with three columns:

SELECT *
FROM TABLE (get_data('1234,56,20061010')
RETURNS (col1 INTEGER, col2 BYTEINT, col3 DATE))
AS t1;

Here is an example of how to invoke the table function using the columns from a derived table as input arguments:

SELECT tf.col1, tf.col2, tf.col3, tf.col4
FROM raw_cust,
     TABLE (get_data(raw_cust.text)
RETURNS (col1 INTEGER, col2 BYTEINT, col3 DATE, col4 VARCHAR(5)))
AS tf;

Here is the definition of the raw_cust table:

CREATE TABLE raw_cust (C1 INT, text VARCHAR(30));

INSERT INTO raw_cust (1,'1356,122,20061009,abc');