Documentation
(C) IBM Corp. 1996, 1999

Text Extender: Administration and Programming

DesOpenDocument

Purpose

Receives a browse session pointer, a handle, and an option (DES_EXTENDED or DES_FAST) indicating whether the text document should be analyzed with or without the use of a dictionary. It prepares the text document that corresponds to the handle to get the document text and highlighting information, and it returns a document handle that is used for iteratively calling DesGetMatches.

Syntax

DESRETURN
  DesOpenDocument
    (DESBROWSESESSION    BrowseSession,
     SQLCHAR             *pHandle,
     DESUSHORT           HandleLength,
     DESMATCHMODE        MatchMode,
     DESHANDLE           *pDocumentHandle,
     DESMESSAGE          *pErrorMessage);

Function arguments

Table 13. DesOpenDocument arguments
Data Type Argument Use Description
DESBROWSESESSION BrowseSession input Browse session handle.
SQLCHAR * pHandle input Pointer to a handle extracted from the database.
DESUSHORT HandleLength input Length of pHandle (DES_NTS cannot be used).
DESMATCHMODE MatchMode input Mode to determine whether a dictionary is used for finding the highlighting information.

DES_FAST
Do not use a dictionary

DES_EXTENDED
Use a dictionary
DESHANDLE * pDocumentHandle output A document handle for iteratively calling DesGetMatches.
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.

Usage

DES_FAST and DES_EXTENDED refer to the use of linguistic processing for finding which terms to highlight in the browsed text. See Linguistic processing for browsing for more information. Specify DES_FAST to use basic text analysis, and DES_EXTENDED to use extended matching.

For the mapping between the SQL data types and C data types, you must use the SQL symbolic name SQL_VARBINARY for a handle. The type of host variables pointing to the C representation of TextHandle values is SQLCHAR*.

Text Extender allocates storage for the browse information. The application program must free this storage and related resources by calling DesFreeBrowseInfo.

Because TextHandle values are bit data and contain several '\0' characters, you must specify the length of pHandle.

The caller must have read access to the table containing the text document referred to by pHandle.

Return codes

RC_SUCCESS
 
RC_ALLOCATION_ERROR
RC_INTERNAL_ERROR
RC_INVALID_MATCH_OPTION
RC_INVALID_PARAMETER
RC_INVALID_SESSION
RC_SE_DOCUMENT_NOT_ACCESSIBLE
RC_SE_DOCUMENT_NOT_FOUND
RC_SE_INCORRECT_HANDLE
RC_SE_IO_PROBLEM
RC_SE_LS_FUNCTION_FAILED
RC_SE_LS_NOT_EXECUTABLE
RC_SE_MAX_NUMBER_OF_BUSY_INDEXES
RC_SE_NOT_ENOUGH_MEMORY
RC_SE_REQUEST_IN_PROGRESS
RC_SE_UNKNOWN_INDEX_NAME
RC_SE_UNEXPECTED_ERROR

Restrictions

This function can be called only after you have started a browse session by calling DesStartBrowseSession.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]