DB2 Version 10.1 for Linux, UNIX, and Windows

Introducing the db2text commands

You can access the NetSearch Extender functionality using the db2text command.

About this task

Here is an example of a Net Search Extender command:
db2text ENABLE DATABASE FOR TEXT
For every create and index maintenance command, you can specify the database, user, and password.
db2text ... connect TO database USER userID USING password
Note: if you leave out the connect options in the db2text command, the environment variable DB2DBDFT specifies the database.
To display a list of commands, enter the following command:
db2text ?
To display the syntax of an individual command, enter the following command:
db2text ? command

Example

For example, to display the syntax of the CREATE INDEX command, use the following command:
db2text ? CREATE INDEX

db2text returns 0 if the command has been processed successfully, and 1 if the command has not been processed. Note that if there are document errors but the index still updates, the db2text command returns 0 with a warning message. Information about document errors can be found in the event table of the index.

What to do next

Depending on your operating system and your active command shell, the system interprets special characters such as ?, (, ), *, !, and ". Therefore, if the command contains these characters, use quotation marks or an escape character.

Here is an example of a UNIX command that uses special characters:
db2 "SELECT * FROM sample WHERE CONTAINS (DESCRIPTION, '\"enable\"') = 1"