Creating a text search index

The Db2 database administrator runs a program that calls the SYSPROC.SYSTS_CREATE stored procedure to create a text search index.

Before you begin

The Db2 table must contain a ROWID column. To avoid search performance problems, there must be a Db2 index on the ROWID column. You can create the Db2 index after creating the text search index.

Procedure

To create a text search index on an existing Db2 table with a column that contains text:

Run a program that calls the SYSPROC.SYSTS_CREATE stored procedure.

Results

The text search index is empty until the first time that you run an update of the text search index.

Example

The following example shows a sample program that creates a text search index by calling the SYSPROC.SYSTS_CREATE stored procedure.

CALL SYSPROC.SYSTS_CREATE('IXSCHEMA', 'IXNAME', 'TABSCHEMA.TABNAME(COLNAME)', ' ');
CALL SYSPROC.SYSTS_UPDATE('IXSCHEMA', 'IXNAME', ' ' );