DB2 10.5 for Linux, UNIX, and Windows

ALTER METHOD statement

The ALTER METHOD statement modifies an existing method by changing the method body associated with the method.

Invocation

This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is in effect for the package (SQLSTATE 42509).

Authorization

The privileges held by the authorization ID of the statement must include at least one of the following authorities:
  • CREATE_EXTERNAL_ROUTINE authority on the database, and at least one of:
    • ALTERIN privilege on the schema of the type
    • Owner of the type, as recorded in the OWNER column of the SYSCAT.DATATYPES catalog view
  • DBADM authority

Syntax

Read syntax diagramSkip visual syntax diagram
>>-ALTER--| method-designator |--------------------------------->

>--EXTERNAL NAME--+-'string'---+-------------------------------><
                  '-identifier-'   

method-designator

|--+-METHOD--method-name--+-------------------------+--FOR--type-name-+--|
   |                      '-(--+---------------+--)-'                 |   
   |                           | .-,---------. |                      |   
   |                           | V           | |                      |   
   |                           '---data-type-+-'                      |   
   '-SPECIFIC METHOD--specific-name-----------------------------------'   

Description

method-designator
Uniquely identifies the method to be altered. For more information, see Function, method, and procedure designators.
EXTERNAL NAME 'string' or identifier
Identifies the name of the user-written code that implements the method. This option can only be specified when altering external methods (SQLSTATE 42849).

Notes

Example

Alter the method DISTANCE() in the structured type ADDRESS_T to use the library newaddresslib.
   ALTER METHOD DISTANCE()
     FOR ADDRESS_T
     EXTERNAL NAME 'newaddresslib!distance2'