|
Use the ALTER ROUTINE statement to change the routine modifiers or pathname of a previously defined user-defined routine (UDR).
|
The ALTER ROUTINE statement allows you to modify a previously-defined UDR to tune its performance. With this statement you can modify characteristics that control how the UDR executes. You can also add or replace related UDRs that provide alternatives for the optimizer, which can improve performance.
This statement is useful when you do not know whether a UDR is a user-defined function or a user-defined procedure. When you use this statement, the database server alters the appropriate user-defined procedure or user-defined function.
All modifications take effect on the next invocation of the UDR.
To use the ALTER ROUTINE statement, you must be the owner of the UDR or have the DBA privilege.
When you use this statement, the type of UDR cannot be ambiguous. The UDR that you specify must refer to either a user-defined function or a user-defined procedure. If either of the following conditions exist, the database server returns an error:
Use the following keywords to introduce the items in the UDR that you want to modify.
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 UDR so that it can be executed in parallel in the context of a parallelizable data query statement.
Suppose you have an external function func1 that is set to handle null values and has a cost per invocation set to 40. The following ALTER ROUTINE statement adjusts the settings of the function by dropping the ability to handle null values, tunes the func1 by changing the cost per invocation to 20, and indicates that the function can execute in parallel.
Note also, that because the name func1 is not unique to the database, the data type parameters are specified so that the routine signature would be unique. If this function had a Specific Name, for example, raise_sal, specified when it was created, you could identify the function with the following first line:
Related Statements: ALTER FUNCTION, ALTER PROCEDURE, 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.