17.05 - Executing a Function Mapping - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1146-175K
Language
English (United States)

In this scenario, the Attribution function mapping is on the local Vantage system in SYSLIB and in the database alias_db.

In the statement below, because user u1 does not specify a database, the system checks for the Attribution function mapping object in database u1. If the Attribution object is not on u1, the system checks SYSLIB. Because the Attribution is on the local system, the system invokes local implementation of Attribution.

SELECT * from Attribution ( 
   ON appl_view_db.input_table PARTITION BY 1
   ON appl_view_db.model1_table as model1 DIMENSION
   USING
      TimestampColumn('tscol')
      EventColumn('eventcol')
      WindowSize('rows:10')
) as dt;

Then, user u1 specifies another database.

DATABASE alias_db;

Then, user u1 can invoke the function mapping Attribution on the remote system with either of the following statements.

SELECT * FROM Attribution ( 
   ON appl_view_db.input_table PARTITION BY 1
   ON appl_view_db.model1_table AS model1 DIMENSION
   USING
      TimestampColumn('tscol')
      EventColumn('eventcol')
      WindowSize('rows:10')
) AS dt;
SELECT * FROM alias_db.Attribution ( 
   ON appl_view_db.input_table PARTITION BY 1
   ON appl_view_db.model1_table AS model1 DIMENSION
   USING
      TimestampColumn('tscol')
      EventColumn('eventcol')
      WindowSize('rows:10')
) AS dt;