Google it ....

Showing posts with label ORA-29907. Show all posts
Showing posts with label ORA-29907. Show all posts

Monday, November 13, 2017

ORA-29907 : found duplicate labels in primary invocations

I have a mailmessages table with two different text indexes on subject and body columns and when I try to execute query:

select *
  from mailmessages
 where (CONTAINS(body, '%oracle%', 1) > 0)
    or (CONTAINS(subject, '%oracle%', 1) > 0)
Appears next error:
ORA-29907 : found duplicate labels in primary invocations

Solution : Problem is that we are using same label 1 for both search criteria, therefore we can execute above query without labels or with different labels :

select *
  from mailmessages
 where (CONTAINS(body, '%oracle%', 1) > 0)
    or (CONTAINS(subject, '%oracle%', 2) > 0)
or
select *
  from mailmessages
 where (CONTAINS(body, '%oracle%') > 0)
    or (CONTAINS(subject, '%oracle%') > 0)