Purpose Options for Access Methods

A registered access method is a set of attributes, including a name and options called purpose options, that you can use to accomplish the following tasks:
  • Specify which functions perform data access and manipulation tasks, such as opening, reading, and closing a data source.
  • Set configuration options, such as a storage-space type.
  • Set flags, such as enabling rowid interpretation.

You specify purpose options when you create an access method with the CREATE ACCESS_METHOD statement. To change the purpose options of an access method, use the ALTER ACCESS_METHOD statement.

Each task, value, or flag keyword corresponds to a column name in the sysams system catalog table. The keywords let you set the following attributes:
  • Purpose function

    A purpose-function attribute maps the name of a user-defined function or method to a task keyword, such as am_create, am_beginscan, or am_getnext. For a complete list of these keywords, see the “Task” category in the table in Purpose Functions, Flags, and Values. The external_routine specifies the corresponding function (C) that you supply for the access method. Example setting:

    am_create = FS_create
  • Purpose flag

    A purpose flag indicates whether an access method supports a given SQL statement or keyword. Example setting:

    am_rowids
  • Purpose value

    These string, character, or numeric values provide configuration information that a flag cannot supply. Example setting:

    am_sptype = 'X'

To enable a user-defined function or method as a purpose function, you must first register the C function or Java™ method that performs the appropriate tasks, using the CREATE FUNCTION statement, and then set the purpose keyword equal to the registered function or method name. This creates a new access method. An example on page ALTER ACCESS_METHOD statement adds a purpose method to an existing access method.

To enable a purpose flag, specify the name without a corresponding value.

To clear a purpose-option setting in the sysams table, use the DROP clause of the ALTER ACCESS_METHOD statement.