The SYSTS_ADMIN_CMD procedure is used by applications to
run text search administrative commands using the SQL CALL statement.
Syntax
>>-SYSTS_ADMIN_CMD--(--command-string--,--message-locale--,--message--)-><
The schema is SYSPROC.
Procedure parameter
- command-string
- An input argument of type VARCHAR (32K) that specifies a single
text search index administration command that is to be executed. The
command syntax is the same as the DB2® Text Search command with the exception of the connection
options. Connection options are not supported through this procedure.
Commands that are run through this procedure use the current connection.
- message-locale
- An input argument of type VARCHAR (33) that specifies the required
language for any error message text 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 an operation that is considered successful.
Authorization
EXECUTE privilege on the
SYSTS_ADMIN_CMD procedure.
The procedure currently supports the following DB2 Text Search commands:
- ALTER INDEX
- CLEAR COMMAND LOCKS
- CLEAR EVENTS
- CREATE INDEX
- DISABLE DATABASE
- DROP INDEX
- ENABLE DATABASE
- UPDATE INDEX
Example
Update text search index
MYTEXTINDEX in schema
DB2TS and return
any error messages in English.
CALL SYSPROC.SYSTS_ADMIN_CMD
('UPDATE INDEX DB2TS.MYTEXTINDEX FOR TEXT','en_US', ?)";
The following example is a sample output from this
query.
Value of output parameters
--------------------------
Parameter Name : MESSAGE
Parameter Value : CIE00001 Operation completed successfully.
Return Status = 0
Usage notes
- If the execution of the command is not successful, SQLCODE -20427
and SQLSTATE 38H14 is returned with the text search specific error
message. For example, if index MYTEXTINDEX already exists and the
following statement is issued:
CALL SYSPROC.SYSTS_ADMIN_CMD ('CREATE INDEX MYTEXTINDEX FOR TEXT
ON DB2TS.TEXTBOOKS (STORY)', 'en_US', ?)
the index creation will fail with the following error
message. SQL20427N An error occurred during a text search administration
procedure or command. The error message is "CIE00201 Text search
index "DB2TS "."MYTEXTINDEX" already exists. ". SQLSTATE=38H14
- If
an SQLCODE is returned by the procedure, the message might be truncated.
Full message information can be found in the db2diag log files.