Forum Stats

  • 3,874,367 Users
  • 2,266,736 Discussions
  • 7,911,832 Comments

Discussions

CTX_THES has_relation function

630530
630530 Member Posts: 25
edited Sep 9, 2008 11:46AM in Text
Hello,

If I invoke the has_relation function of the CTX_THES package, in case the phrase I am searching for has not previously been inserted in the thesaurus, an exception is thrown:

ORA-20000: Oracle Text error:
DRG-11704: phrase HOUSE does not exist

Is there a way I can test whether a term is already present in my thesaurus without an exception being thrown?


Thanks in advance and best regards,
Martin
Tagged:

Best Answer

  • Barbara Boehmer
    Barbara Boehmer Member Posts: 4,625 Gold Trophy
    edited Sep 9, 2008 11:46AM Answer ✓
    You can select from the data dictionary:
    [email protected]_11g> SELECT COUNT (*)
      2  FROM   ctx_thes_phrases
      3  WHERE  thp_thesaurus = 'DEFAULT'
      4  AND    UPPER (thp_phrase) = 'HOUSE'
      5  /
    
      COUNT(*)
    ----------
             0
    
    [email protected]_11g>
    Edited by: Barbara Boehmer on Sep 9, 2008 8:39 AM
    changed query to search DEFAULT thesaurus for HOUSE phrase to match posted problem
    and added UPPER to allow for case insensitivity

Answers

This discussion has been closed.