informix
Informix Guide to SQL: Syntax
SQL Statements

ALTER FUNCTION

Use the ALTER FUNCTION statement to change the routine modifiers or pathname of a user-defined function.

Syntax

Element Purpose Restrictions Syntax
function Name of the user-defined function to modify The function must exist (that is, be registered) in the database. If the name does not uniquely identify a function, you must enter one or more appropriate values for parameter_type. Database Object Name, p. 4-50
parameter_type Data type of the parameter The data type (or list of data types) must be the same types (and specified in the same order) as those specified in the CREATE FUNCTION statement when the function was created. Identifier, p. 4-205

Usage

The ALTER FUNCTION statement allows you to modify a user-defined function to tune its performance. With this statement you can modify characteristics that control how the function executes. You can also add or replace related UDRs that provide alternatives for the optimizer, which can improve performance.

All modifications take effect on the next invocation of the function.

Privileges

To use the ALTER FUNCTION statement, you must be the owner of the UDR or have the DBA privilege.

Keywords That Introduce Modifications

Use the following keywords to introduce the items in the user-defined function that you want to modify.

Keyword Purpose
ADD Introduces a routine modifier that you want to add to the user-defined function
MODIFY Introduces a routine modifier for which you want to modify a value
DROP Introduces a routine modifier that you want to remove from the user-defined function
MODIFY EXTERNAL NAME
(for external functions only)
Introduces a new location for the executable file
WITH Introduces all modifications

If the routine modifier is a Boolean value, MODIFY sets the value to be T (that is, it is the equivalent of using the keyword ADD to add the routine modifier). For example, both of the following statements alter the func1 function so that it can be executed in parallel in the context of a parallelizable data query statement.

For a related example, see Altering Routine Modifiers Example.

Related Information

Related Statements: ALTER PROCEDURE, ALTER ROUTINE, CREATE FUNCTION, CREATE PROCEDURE, DROP FUNCTION, DROP PROCEDURE, and DROP ROUTINE

For a discussion on how to create and use SPL routines, see the Informix Guide to SQL: Tutorial.

For a discussion of how to create and use external routines, see Extending Informix Dynamic Server 2000.

For information about how to create C UDRs, see the DataBlade API Programmer's Manual.


Informix Guide to SQL: Syntax, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved