ALTER METHOD

Alter an existing method.

alter_method.png

 

Usage

Embedded/Interactive/Module/ODBC/JDBC.

Description

With the ALTER METHOD statement it is possible to change the procedural sql statement used in the routine body for a method. It is not possible to alter routine attributes for a method but this is done by altering the method specification on which the method is based. (See ALTER TYPE for details.)

The method-name should follow the normal rules for naming database objects, see Naming Objects.

If no schema name is given, it is assumed that the method is defined in a schema with the same name as the current ident.

If the method name is unique within the schema, it is not necessary to provide a data type list.

If there are multiple methods with the same name, it is possible to identify the method by using a specific name or by providing a parameter list. How to use a specific name when altering a routine is described in the ALTER ROUTINE statement (ALTER ROUTINE.)

The parameter-name should follow the normal rules for naming SQL identifiers, see SQL Identifiers.

Restrictions

It is only the creator of the schema in which the method is defined, that is allowed to alter the method.

If the altered routine body contains references to objects on which the current ident does not have the applicable privilege with grant option and there are other objects referencing the method being altered, the alter operation is not allowed.

In addition, all restrictions for CREATE METHOD also applies. (See CREATE METHOD.)

Notes

Any privilege on the method granted to other idents are retained.

It is possible to alter a method that is part of a module.

Example

Example on how to change the procedure sql statement in a function definition:

 

CREATE STATIC METHOD C_from_F (Fdegrees integer) FOR DEGREES

    RETURN CAST((Fdegrees - 42) * 5.0 / 9 + 0.5 AS integer);

 

ALTER STATIC METHOD C_from_F (Fdegrees integer)

    RETURN CAST((Fdegrees - 32) * 5.0 / 9 + 0.5 AS integer);

Standard Compliance

Standard

Compliance

Comments

 

Mimer SQL extension

The ALTER METHOD statement is a Mimer SQL extension.