Java Constant/Variable Mode Table Function | UFC Code Examples | Vantage - 17.10 - Java Constant/Variable Mode Table Function - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

This example shows the Java code for a table function that supports both Tbl.TBL_MODE_CONST and the Tbl.TBL_MODE_VARY modes. The Tbl.TBL_MODE_CONST is very simple in that any one AMP will extract the data out of the text string that is passed in.

This example extracts some data out of a 'raw' text field to generate a bunch of rows. The raw data is in this format:

store_number,entries:entry[;...]
entry
customer_ID,item_ID
store_number
Number that identifies the store that sold the items to the customers.
entries
Number of items sold.
customer_ID
Customer identifier.
item_ID
Item identifier.