Mutator methods for structured types

A mutator method exists for each attribute of an object.

The instance of a structured type on which a method is invoked is called the subject instance of the method. When the mutator method invoked on a subject instance receives a new value for an attribute, the method returns a new instance with the attribute updated to the new value. So, for type Person_t, Db2® creates mutator methods for each of the following attributes: name, age, and address.

The mutator method Db2 creates for attribute age, for example, has the following format:

   ALTER TYPE Person_t 
      ADD METHOD AGE(int)
      RETURNS Person_t;