CREATE TEXT INDEX statement

Description

Creates a TEXT index.

Syntax

CREATE TEXT INDEX text-index-name
   ON [ owner.]table-namecolumn-name, ...)
   [ IN dbspace-name ]
   [ CONFIGURATION [ owner.]text-configuration-name]
   [ IMMEDIATE REFRESH ]

Examples

Example 1

This example creates a TEXT index, myTxtIdx, on the CompanyName column of the Customers table in the iqdemo database. The max_term_sixteen text configuration object is used.

CREATE TEXT INDEX myTxtIdx ON Customers (CompanyName );
CONFIGURATION max_term_sixteen;

Usage

You cannot create a TEXT index on views or temporary tables. You cannot create a TEXT index on an IN SYSTEM materialized view.

TEXT indexes will not be replicated to join indexes tables. A TEXT index can be created on a column of a table that participates in a join index.

The BEGIN PARALLEL IQ…END PARALLEL IQ statement does not support CREATE TEXT INDEX.

ON Clause Specifies the table and column on which to build the TEXT index.

IN clause Specifies the dbspace in which the TEXT index is located. If this clause is not specified, then the TEXT index is created in the same dbspace as the underlying table.

CONFIGURATION clause Specifies the text configuration object to use when creating the TEXT index. If this clause is not specified, the default_char text configuration object is used.

REFRESH clause IMMEDIATE REFRESH is used as the default and is the only permitted value for tables in Sybase IQ. Specify IMMEDIATE REFRESH to refresh the TEXT index each time changes in the underlying table impact data in the TEXT index.

An IMMEDIATE REFRESH TEXT index is populated at creation and is refreshed whenever the data in the underlying column is changed. Once a TEXT index is created, you cannot change it to, or from, IMMEDIATE REFRESH.


Side effect

Automatic commit.

Permissions

You must be the owner of the underlying table, or have DBA authority, or have REFERENCES permission.

You must have CREATE permission on the dbspace.