17.00 - Example: SHOW for a SELECT Request with a Function Mapping - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

In this example, the SHOW for a SELECT request statement includes a function mapping definition and a foreign server definition that is part of the function mapping definition.

Below is the function mapping definition.

CREATE FUNCTION MAPPING appl_view_db.sessionize 
	FOR sessionize SERVER coprocessor 
	USING 
	    Timecolumn, timeout(100), clicklag(20), emitnull;

Following is the SHOW SELECT request.

SHOW SELECT * from test_db.sessionize ( 
   	   ON test_user.t1 as InputTable PARTITION BY 1
   	   USING
         TimeColumn('periodcol'), 
         clicklag(200)
	) as dt;

The SHOW request statement returns the definitions of the table, the function mapping, and the foreign server.

*** Text of DDL statement returned.
-------------------------------------------------------------------
CREATE SET TABLE TEST_USER.t1 ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO,
     MAP = TD_MAP1
     (
      userid INTEGER,
      periodcol TIMESTAMP(6),
      page VARCHAR(1000) CHARACTER SET LATIN NOT CASESPECIFIC)
PRIMARY INDEX ( userid );
*** Text of DDL statement returned.
-------------------------------------------------------------------
CREATE FUNCTION MAPPING appl_view_db.sessionize 
FOR sessionize SERVER coprocessor 
USING 
Timecolumn, timeout(100), clicklag(20), emitnull;
*** Text of DDL statement returned.
-------------------------------------------------------------------
CREATE FOREIGN SERVER TD_SERVER_DB.opt_srv1
EXTERNAL SECURITY DEFINER TRUSTED TESTAUTH USING
link  ('sdlc4673sdlc4675')
version  ('active')
DO IMPORT WITH TD_SYSFNLIB.QGINITIATORIMPORT ,
DO EXPORT WITH TD_SYSFNLIB.QGINITIATOREXPORT ;