Show TOC

ALTER FUNCTION StatementLocate this document in the navigation structure

Modifies an existing function. Include the entire modified function in the ALTER FUNCTION statement.

Syntax

Syntax 1

ALTER FUNCTION [ <owner>.]<function-name> function-definition

function-definition:
   CREATE FUNCTION <syntax>

Syntax 2

ALTER FUNCTION<owner>.]<function-name>
   SET HIDDEN

Syntax 3

ALTER FUNCTION<owner>.]<function-name>
   RECOMPILE
Parameters

(back to top)

  • SET HIDDEN to scramble the definition of the associated function and cause it to become unreadable. The function can be unloaded and reloaded into other databases.
    Caution

    The SET HIDDEN clause setting is irreversible. If you need the original source again, you must maintain it outside the database.

  • RECOMPILE to recompile a user-defined function. When you recompile a function, the definition stored in the catalog is re-parsed and the syntax is verified. The preserved source for a function is not changed by recompiling. When you recompile a function, the definitions scrambled by the SET HIDDEN clause remain scrambled and unreadable.
Usage

(back to top)

  • Syntax 1 identical in syntax to the CREATE FUNCTION statement except for the first word. Either version of the CREATE FUNCTION statement can be altered.

    Existing permissions on the function are maintained and do not have to be reassigned. If a DROP FUNCTION and CREATE FUNCTION were carried out, execute permissions must be reassigned.

Side effects:
  • Automatic commit
Standards

(back to top)

  • SQL—Vendor extension to ISO/ANSI SQL grammar.
Permissions

(back to top)

Alter a Watcom SQL or Transact-SQL function – Requires one of:
  • ALTER ANY PROCEDURE system privilege.
  • ALTER ANY OBJECT system privilege.
  • You own the function.
Alter an external C/C++ Scalar or Aggregate, or external Java function – Requires one of:
  • Requires CREATE EXTERNAL REFERENCE system privilege.
  • Also requires one of:
    • ALTER ANY PROCEDURE system privilege.
    • ALTER ANY OBJECT system privilege.
    • You own the function.