cancel
Showing results for 
Search instead for 
Did you mean: 

CONTAINS suffix search

Former Member
0 Kudos

Dear support team,

your online help shows up, that you can use text indexes with the search function CONTAINS to do a prefix search ( SyBooks Online )

- for example: SELECT x FROM y WHERE CONTAINS(x, 'a*') searches for all rows where x starts with a.

- we want to use something like SELECT x FROM y WHERE CONTAINS(x, '*a')  where x ends with a

- unfortunately we get the following error, when executing the second example:

Could not execute statement.

Text query parser error: 'in a CONTAINS search condition, '*' is allowed

for prefix search only' at or before character 1

*<--a

SQLCODE=-1164, ODBC 3 State="HY000"

Line 1, column 1

select x

from z

where contains(x, '*a')

I would be most grateful if you can look into this as soon as possible.

Kind regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member207653
Active Participant
0 Kudos

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sqlanywhere.12.0.1/dbusage/full-t...

I have jsut reproduced the same error with both SQL Anywhere 12 and 17. In the Product manual page you have shared, there is no example similar to what you are trying to do.

From the page above, the full text search feature allows you to search fior the beginning portion of a term. This is called a prefix search. To perform a prefix search, you specify the prefix you want to search for, followed by an asterik. This is called prefix term.