SYSTS_ADMIN_CMD procedure - Run text search administration commands
The SYSTS_ADMIN_CMD procedure is used by applications to run text search administrative commands using the SQL CALL statement.
Authorization
EXECUTE privilege on the SYSTS_ADMIN_CMD procedure and the required authorization as listed for the requested operation.
Default PUBLIC privilege
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the procedure is automatically created.
Syntax
The schema is SYSPROC.
Procedure parameters
-
command-string
- An input argument of type VARCHAR (32 K) that specifies a single Text Search index administration
command to be executed. The command syntax is the same as the Text Search command except for
the connection options, which are not supported through this procedure.
Commands that you issue through this procedure use the current connection.The procedure supports the following Text Search commands:
- ALTER INDEX
- CLEAR COMMAND LOCKS
- CLEAR EVENTS
- CREATE INDEX
- DISABLE DATABASE
- DROP INDEX
- ENABLE DATABASE
- RESET PENDING
- UPDATE INDEX
message-locale
- An input argument of type VARCHAR(33) that specifies the language for any error message text that is 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.
Example
The following example updates the
MYTEXTINDEX text search index in schema DB2TS and returns any error
messages in English:
CALL SYSPROC.SYSTS_ADMIN_CMD
('UPDATE INDEX DB2TS.MYTEXTINDEX FOR TEXT','en_US', ?)";
Sample output is as follows:
Value of output parameters
--------------------------
Parameter Name : MESSAGE
Parameter Value : CIE00001 Operation completed successfully.
Return Status = 0
Usage notes
If the command does not run
successfully, SQLCODE -20427 and SQLSTATE 38H14 are returned with
the text-search-specific error message. For example, if index MYTEXTINDEX
exists and the following statement is issued:
CALL SYSPROC.SYSTS_ADMIN_CMD ('CREATE INDEX MYTEXTINDEX FOR TEXT
ON DB2TS.TEXTBOOKS (STORY)', 'en_US', ?)
Index creation fails 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 is in the db2diag log files.
