16.20 - Example: Use SYSUIF.INSTALL_FILE to Install Files and then Run the SCRIPT Table Operator - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Administration
Programming Reference
Publication ID
B035-1210-162K
Language
English (United States)

The following example installs a script and other files, and then executes the SCRIPT table operator.

DATABASE mydb;
SET SESSION SEARCHUIFDBPATH = mydb;
call SYSUIF.install_file('my_analytics',
                         'cz!my_analytics.sh!/tmp/my_analytics.sh');
call SYSUIF.install_file('my_model',
            'cz!my_model.model!/tmp/my_model.sh');
call SYSUIF.install_file('my_data',
                         'cz!my_data.dat!/tmp/my_data.dat');
Select * from SCRIPT( on data_table
		SCRIPT_COMMAND('./mydb/my_analytics.sh –mymodel ./mydb/my_model.model –myadditionaldata ./mydb/my_data.dat')
		RETURNS('*','score varchar(10)');