16.20 - Protected Mode Execution - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

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

Protected Mode Execution Option

The ALTER METHOD statement provides an execution option that controls whether Teradata Database invokes the method directly or runs the method indirectly as a separate process.

The option applies to methods that were created without specifying the EXTERNAL SECURITY clause in the CREATE METHOD or REPLACE METHOD statement. Methods that specify the EXTERNAL SECURITY clause are executed using separate secure server processes.

IF ALTER METHOD specifies … THEN Teradata Database …
EXECUTE PROTECTED runs the method indirectly as a separate process.

If the method fails during execution, the transaction fails.

EXECUTE NOT PROTECTED invokes the method directly.
If the ALTER METHOD statement specifies EXECUTE NOT PROTECTED, and the UDM fails during execution, Teradata Database software will probably restart.

Only an administrator, or someone with sufficient privileges, can use the ALTER METHOD statement.

Choosing the Correct Execution Option

Use the following table to choose the correct execution option for UDMs.

IF … THEN use …
you are in the development phase and are debugging a UDM EXECUTE PROTECTED.
the UDM opens a file or uses another operating system resource that requires tracking by the operating system EXECUTE PROTECTED.

Running such a UDM in nonprotected mode could interfere with the proper operation of Teradata Database.

the UDM does not use any operating system resources EXECUTE NOT PROTECTED.

Running a UDM in nonprotected mode speeds up processing considerably.

Use this option only after thoroughly debugging the UDM and making sure it produces the correct output.

Related Topics

FOR more information on … SEE …
protected mode process and server administration Protected Mode Process and Server Administration for C/C++ External Routines.
ALTER METHOD and the EXECUTE PROTECTED option Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
the privileges associated with UDTs Teradata Vantage™ - Database Administration, B035-1093.