Coding a set of UDFs for a security constraint must be coordinated with the purpose and structure of the corresponding CONSTRAINT object. See Working with Security Constraints.
- Code and file each security constraint UDF as shown in Teradata Vantage™ - SQL External Routine Programming, B035-1147.You can create more than one UDF for an SQL operation type, but you can only specify one UDF of each type in a security CONSTRAINT object.
- Use the CREATE FUNCTION statement to define a FUNCTION object for each UDF, as documented in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
- To avoid performance problems that occur when running the UDF in protected mode, use the ALTER FUNCTION statement to set non-protected mode execution for the function:
ALTER FUNCTION SYSLIB.function_name EXECUTE NOT PROTECTED
If a UDF fails to operate correctly in non-protected mode, it can cause a database restart. Be sure to test each UDF thoroughly before deploying it.