15.00 - Restrictions On Replacing UDFs That Implement Operations On UDTs - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

Restrictions On Replacing UDFs That Implement Operations On UDTs

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:
  • a DROP CAST (see “DROP CAST” on page 793)

    b REPLACE FUNCTION

    c CREATE CAST (see “CREATE CAST/ REPLACE CAST” on page 212)

    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.