The meaning of ORA-29907 error and the fix

I have first time encountered the error:

ORA-29907: found duplicate labels in primary invocations

after testing the change request we have implemented recently. The error message was not very helpful – I was not exactly sure which labels and which invocations 😉 – and as Oracle guru who actually does understand fine details of Oracle Text was visiting sunny India, I was on my own.

The change addressed an issue in repository search: users were asking for more flexible processing of full text search phrases: instead of e.g. searching for “unit test” search for document that contains both unit AND test. The text was parsed in Java and the SQL generator produced instead of something like


SELECT * FROM DOCUMENT d1 WHERE ROWNUM  5)


SELECT * FROM DOCUMENT d1 WHERE ROWNUM  5)
AND ( CONTAINS(d1.document,'unit',1) > 5)

I am still unsure what primary invocation is, but the above mentioned ‘label’ was the number one. After changing the generator to issue sequence numbers in the CONTAINS, everything worked OK:


SELECT * FROM DOCUMENT d1 WHERE ROWNUM  5)
AND ( CONTAINS(d1.document,'unit',2) > 5)

Advertisements
Explore posts in the same categories: databases

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: