This procedure enables DB2® Text Search for the current database.
This procedure must be issued successfully before text
search indexes on columns in tables within the database can be created.
This procedure issues the ENABLE DATABASE FOR TEXT text search administration command on the database server.
Syntax
>>-SYSTS_ENABLE--(--message_locale--,--message--)--------------><
The schema is SYSPROC.
Procedure parameters
- message_locale
- An input argument of type VARCHAR(33) that specifies the locale
to be used for any error message returned. If the argument is null
or an empty string, or the message files for the specified locale
are not available on the server, 'en_US' is used.
- message
- An output argument of type VARCHAR(32K) that specifies a warning
or informational message for a successfully completed operation.
Authorization
The user must
have DBADM privilege to execute the ENABLE DATABASE command.
Examples
Example 1: Enable the database
for text search and return any error messages in English.
CALL SYSPROC.SYSTS_ENABLE('en_US', ?)
The following example is
a sample output for this query.
Value of output parameters
--------------------------
Parameter Name : MESSAGE
Parameter Value : Operation completed successfully.
Return Status = 0
Example 2: In the following example, SYSTS_ENABLE
is called on a database that is already enabled for text search. This
results in an error message to the caller.
CALL SYSPROC.SYSTS_ENABLE('en_US', ?)
The following example is a sample output for this query.
SQL20427N An error occurred during a text search administration
procedure or command. The error message from the text search
product is "CIE00322 Specified or default database already
enabled for text. ". SQLSTATE 38H14
Usage notes
- Text search administration procedures use an existing
connection to the database. The current transaction might be committed
or rolled back depending on the completion of the procedures. It is
therefore recommended to commit all transaction changes before executing
a text search administration procedure to avoid any unexpected impact
from a commit or rollback in the procedure. One way to achieve this
is to turn on AUTOCOMMIT.
Note: You may run into a deadlock if a transaction
is not committed before executing a text search administration operation,
as the same database objects may be affected and the operation waits
for the previous step to commit. This may occur, for example, if AUTOCOMMIT
is turned off and a table is created followed by creating a text index
without an explicit commit between the two transactions.
- When this procedure is run,
- this procedure creates database objects, such as text search administration
catalog tables and views, in the schema SYSIBMTS. These objects are
placed in the default table space of the database (IBMDEFAULTGROUP).
- the established database defaults for text search index are available
in view SYSIBMTS.TSDEFAULTS.
- and when the command has successfully completed, the text search
catalog tables and views are created and are available.