Purpose
Uses a search argument for searching through text documents identified by a text column. The handle data of the found text items is written to a result table. Browse information about rank and the number of matches can also be written to the result table.
Syntax
DESRETURN DesGetSearchResultTable (SQLHDBC hdbc, char *pTableSchema, DESSMALLINT TableSchemaLength, char *pTableName, DESSMALLINT TableNameLength, char *pColumnName, DESSMALLINT ColumnNameLength, char *pSearchArgument, DESSMALLINT ArgumentLength, char *pResultSchema, DESSMALLINT ResultSchemaLength, char *pResultTableName, DESSMALLINT ResultTableNameLength, DESSEARCHOPTION SearchOption, DESBROWSEOPTION BrowseOption, DESBROWSEINFO *pBrowseInfo, DESMESSAGE *pErrorMessage);
Function arguments
Table 12. DesGetSearchResultTable arguments
Data Type | Argument | Use | Description |
---|---|---|---|
SQLHDBC | hdbc | input | A database connection handle. |
char * | pTableSchema | input | The schema of the base table to be searched. |
DESSMALLINT | TableSchemaLength | input | Either the length of pTableSchema (not including a null byte terminator) or DES_NTS. |
char * | pTableName | input | Pointer to the name of the base table to be searched. |
DESSMALLINT | TableNameLength | input | Either the length of pTableName (not including a null byte terminator) or DES_NTS. |
char * | pColumnName | input | Pointer to the name of the column to be addressed by the intended text search. The column must be of type DESTEXTH. |
DESSMALLINT | ColumnNameLength | input | Either the length of pColumnName (not including a null byte terminator) or DES_NTS. |
char * | pSearchArgument | input | Pointer to the text search argument. |
DESSMALLINT | ArgumentLength | input | Either the length of pSearchArgument (not including a null byte terminator) or DES_NTS. |
char * | pResultSchema | input | Pointer to the schema containing the result table. |
DESSMALLINT | ResultSchemaLength | input | Either the length of pSchemaName (not including a null byte terminator) or DES_NTS. |
char * | pResultTableName | input | Pointer to the name of the result table that you have previously created in which the result of the search is to be stored. See Figure 14 for the structure of this table. |
DESSMALLINT | ResultTableNameLength | input | Either the length of pResultTableName (not including a null byte terminator) or DES_NTS. |
DESSEARCHOPTION | SearchOption | input | An option that determines whether you are asking for ranking information,
for the number of matches, or only for the handles of the matching text
documents.
This option determines the content of result table as described in Usage. |
DESBROWSEOPTION | BrowseOption | input | Reserved. |
DESBROWSEINFO * | pBrowseInfo | output | Pointer to browse information or a pointer to null, depending on the value of BrowseOption. |
DESMESSAGE * | pErrorMessage | output | Implementation-defined message text. If an error occurs, Text Extender returns an error code and an error message. The application program allocates the buffer of size DES_MAX_MESSAGE_LENGTH. If pErrorMessage is the null pointer, no error message is returned. |
The connection to the database must be established by the application program calling DesGetSearchResultTable.
The name pResultTableName refers to a result table that you have created in advance. The utility DESRESTB in the sample directory creates a result table for text handles. After the call of this function, the result table contains information identifying text values matching the search argument.
This is the structure of the result table:
Figure 14. Structure of the result table
![]() |
The data type of TEXTHANDLE is DB2TEXTH or DB2TEXTFH. The data type of RANK is DOUBLE. The data type of MATCHES is INTEGER.
The search argument at pSearchArgument is described in Chapter 10, Syntax of search arguments.
If the value of BrowseOption is BROWSE, Text Extender returns browse information from the Text Extender search engine located on the server. pBrowseInfo points to the browse information which is the input to DesStartBrowseSession. If the value of BrowseOption is NO_BROWSE pBrowseInfo points to null.
Return codes