Executing a Function Mapping - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

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;