Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Special Character Parentheses

531177Sep 12 2006
I'm having problems with the parentheses.

SELECT textwords
FROM SOMETABLE
WHERE CONTAINS (TEXTWORDS, 'NAIL HAMMER \(GLUE\)%',1) > 0
SQL> /

TEXTWORDS
--------------------------------------------------------------------------------
NAIL HAMMER (GLUE)

I get what I expected.

SELECT textwords
FROM SOMETABLE
WHERE CONTAINS (TEXTWORDS, 'NAIL HAMMER \(GLUE\)%
OR $(SYN(NAIL HAMMER \(GLUE\) ) )',1) > 0

TEXTWORDS
--------------------------------------------------------------------------------
NAIL HAMMER (GLUE)

I get what I expected.


SQL> SELECT textwords
2 FROM SOMETABLE
3 WHERE CONTAINS (TEXTWORDS, 'NAIL HAMMER \( GLUE \)%
4 OR $(SYN(NAIL HAMMER \( GLUE \) ) )
5 OR ?(SYN(NAIL) & SYN(HAMMER) & SYN( \(GLUE \) ) ) PARENTHESES ADDED
6 OR !(SYN(NAIL) & SYN(HAMMER) & SYN(GLUE))',1) > 0; NOT ADDED
FROM SOMETABLE
*
ERROR at line 2:
ORA-29902: error in executing ODCIIndexStart() routine
ORA-20000: Oracle Text error:
DRG-50925: could not parse return value of PL/SQL
DRG-50901: text query parser syntax error on line 1, column 2


It seems like when you use more then one SYN in the OR statement with the (glue) it gives you an error. Can anyone tell me why.I thought that SYN
automatically added the {} around the words

1 SELECT textwords
2 FROM sometable
3 WHERE CONTAINS (TEXTWORDS, 'NAIL HAMMER \(GLUE\)%
4* OR $(SYN(NAIL HAMMER (GLUE)))',1) > 0
SQL> /
SELECT SOMETABLE
*
ERROR at line 1:
ORA-29902: error in executing ODCIIndexStart() routine
ORA-20000: Oracle Text error:
DRG-50901: text query parser syntax error on line 2, column 35

Why doesn't the above work. Also if you try {} around glue it doesn't work either instead of using the \(


Also I know that using more then one SYN IN A statement may not be the best way to handle this but I can not change the tables.
If there is a better way please let me know.


Any Answers are greatly Apperciated

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2006
Added on Sep 12 2006
0 comments
1,034 views