Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

CREATE OPCLASS

Use the CREATE OPCLASS statement to create an operator class for a secondary-access method.

Only Dynamic Server supports this statement, which is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-CREATE OPCLASS--opclass--FOR--sec_acc_method----------------->
 
                  .-,--------------------------.
                  V                            |
>--STRATEGIES--(----| Strategy Specification |-+--)------------->
 
               .-,----------------.
               V                  |
>--SUPPORT--(----support_function-+--)-------------------------><
 
Element Description Restrictions Syntax
opclass Name that you declare here for a new operator class Must be unique among operator classes within the database Identifier
sec_acc_method Secondary-access method with which the new operator class is associated Must already exist and must be registered in the sysams table Identifier
support_function Support function that the secondary-access method requires Must be listed in the order expected by the access method Identifier

Usage

An operator class is the set of operators that support a secondary-access method for query optimization and building the index. A secondary-access method (sometimes referred to as an index access method) is a set of database server functions that build, access, and manipulate an index structure such as a B-tree, R-tree, or an index structure that a DataBlade module provides.

The database server provides the B-tree and R-tree secondary-access methods. For more information on the btree secondary-access method, see Default Operator Classes.

Define a new operator class when you want one of the following:

You must have the Resource privilege or be the DBA to create an operator class. The actual name of an operator class is an SQL identifier. When you create an operator class, theopclass name must be unique within the database.

When you create an operator class in an ANSI-compliant database, the owner.opclass combination must be unique within the database. The owner name is case sensitive. If you do not put quotes around the owner name (or else set the ANSIOWNER environment variable), the name of the operator-class owner is stored in uppercase letters.

The following CREATE OPCLASS statement creates a new operator class called abs_btree_ops for the btree secondary-access method:

CREATE OPCLASS abs_btree_ops FOR btree
   STRATEGIES (abs_lt, abs_lte, abs_eq, abs_gte, abs_gt)
   SUPPORT (abs_cmp)

An operator class has two kinds of operator-class functions:

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]