Help Needed: Like operator
Posted in 1999
Topics: Data Types & Schema Design
Hi, I have a query like: Select NoteID From Notes Where Notes.NoteMemo LIKE '%good%' It failed because NoteMemo is a text data type field. Can anybody tell me the alternative for LIKE operator for text datatype field? Thanks. Jie
I don't think there is an direct alternative, as the documentation says: "You also cannot use TEXT items in the following ways: * With aggregate functions * With the IN clause * With the MATCHES or LIKE clauses * With the GROUP BY clause * With the ORDER BY clause Maybe you could create a temporary table with a varchar field big enough to hold the maximum text content, select into it and use the temporary table for your purposes. Hth, Chris Brauer
Christian Brauer wrote: > > I don't think there is an direct alternative, as > the documentation says: > > "You also cannot use TEXT items in the following ways: > > * With aggregate functions > * With the IN clause > * With the MATCHES or LIKE clauses > * With the GROUP BY clause > * With the ORDER BY clause > > Maybe you could create a temporary table with > a varchar field big enough to hold the maximum text content, > select into it and use the temporary table for your purposes. If you are using ESQL/C you can use LOC_USER functions to filter the TEXT column in your application after filtering on other keys and keywords in searchable char columns. Art S. Kagel