Restrictions On Replacing UDFs That Implement Operations On UDTs - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
jpx1556733107962.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1184
lifecycle
previous
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.