Input and Output to the Script File - 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™

A script file reads rows from its standard input (stdin) and writes rows to its standard output (stdout). Each input row to the script file is sent as a string with the column values separated by the delimiter specified in the DELIMITER clause. If no DELIMITER clause is specified, the default is a tab. Each input row is separated from the next by a newline character.

The result of the script file must also be a delimited string and the values are converted back to data types specified in the RETURNS clause. Each output row must separated from the next by a newline character (\n).

Nulls are represented as empty strings. For example, the following example represents the input string for a row with three integer values where the last two are NULL (delimited by colons):

1::\n

The first value is 1, there is no value between the first and second delimiter, and no value between the second delimiter and the newline character. The input row is equivalent to (1, NULL, NULL).

If the return values from the script file are not in a delimited string format, the script execution fails.