|Oracle8i interMedia Text Migration
Release 2 (8.1.6)
Part Number A77061-01
Querying, 7 of 12
Composite textkey queries are queries on a base table that is indexed with a composite textkey.
The first step in issuing a composite textkey query is to create a result table manually with a composite textkey consisting of two columns as follows:
You then join the result and base table with and AND operator in the WHERE condition. For example:
exec ctx_query.contains('ARTICLE2_POLICY','petroleum','CTX_TEMP2') SELECT score, title FROM CTX_TEMP2, TEXTTAB2 WHERE texttab2.PK=ctx_temp2.textkey AND texttab2.PK2=ctx_temp2.textkey2 ORDER BY score DESC;
The 8.1 query is a basic SELECT statement. Because no result tables are used, there is no join between a result table and a base table as in pre-8.1 CONTAINS. You thus issue queries against a composite textkey table the same way you issue a query against a table with a single column textkey.
textab2 is the composite textkey table, the above query is written as: