Restrictions On Replacing UDFs That Implement Operations On UDTs - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™
The following restrictions apply to replacing UDFs that implement operations on UDTs:
  • A UDF used as a cast, ordering, or transform routine must be created in the SYSUDTLIB database.
  • A UDF used to implement either ordering or transform functionality for a UDT can only be replaced if all the following conditions are satisfied:
    • The REPLACE FUNCTION specification must match exactly with the existing method specification in the dictionary.

      This means that the function name, parameter list, method entry point name within the EXTERNAL clause, and so on must all match.

    • The execution mode for the UDF being replaced must be EXECUTE PROTECTED.

      If the function is currently set to EXECUTE NOT PROTECTED mode, then you must perform an ALTER FUNCTION statement to change the mode to EXECUTE PROTECTED before you can perform the REPLACE FUNCTION statement.

      Unless all of these conditions have been met when you submit the REPLACE FUNCTION statement, the system returns an error to the requestor.

  • A UDF that implements casting functionality for a UDT can only be replaced by performing the following SQL statements in the order indicated:
    1. DROP CAST
    2. REPLACE FUNCTION
    3. CREATE CAST

    You cannot use REPLACE FUNCTION by itself to perform this task. An attempt to replace a casting function directly using REPLACE FUNCTION aborts and returns an error to the requestor. See DROP CAST in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144. See CREATE CAST and REPLACE CAST.