Oracle Text Reference
Release 9.0.1

Part Number A90121-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

CTX_THES Package , 29 of 30


TT

This function returns the top term of a phrase as recorded in the specified thesaurus.

Syntax 1: Table Result

CTX_THES.TT(restab IN OUT NOCOPY EXP_TAB,
            phrase IN VARCHAR2,
            tname  IN VARCHAR2 DEFAULT 'DEFAULT');

Syntax 2: String Result

CTX_THES.TT(phrase IN VARCHAR2,
            tname  IN VARCHAR2 DEFAULT 'DEFAULT')
RETURN varchar2;
restab

Optionally, specify the name of the expansion table to store the results. This table must be of type EXP_TAB which the system defines as follows:

type exp_rec is record (
    xrel varchar2(12),
    xlevel number,
    xphrase varchar2(256)
);
type exp_tab is table of exp_rec index by binary_integer;

See Also:

"CTX_THES Result Tables and Data Types" in Appendix A, "Result Tables" for more information about EXP_TAB. 

phrase

Specify phrase to lookup in thesaurus.

tname

Specify thesaurus name. If not specified, system default thesaurus is used.

Returns

This function returns the top term string in the form:

{tt}

Example

Consider a thesaurus MY_THES with the following broader term entries for dog:

DOG 
   BT1 CANINE 
     BT2 MAMMAL 
       BT3 VERTEBRATE 
         BT4 ANIMAL

To look up the top term for DOG, execute the following code:

 declare 
  terms varchar2(2000); 
begin 
  terms := ctx_thes.tt('DOG','MY_THES'); 
  dbms_output.put_line('The top term for DOG is: '||terms); 
end; 

This code produces the following output:

The top term for dog is: {ANIMAL}

Related Topics

OUTPUT_STYLE

Top Term (TT) Operator in Chapter 3, "CONTAINS Query Operators"


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback