Comparing TEXT fields
Posted in 2000
Topics: General Discussion
I need to compare a TEXT field with a string. I don't know if it's possible.
In SQL Server the syntax is like this:
SELECT *
FROM costumer
WHERE observ LIKE "%Hola%"
What is the syntax in Informix?
My Informix Engine version is 7.31 in NT Server 4, Service Pack 5.
Thanks!
digicom wrote:
>
> I need to compare a TEXT field with a string. I don't know if it's possible.
> In SQL Server the syntax is like this:
>
> SELECT *
> FROM costumer
> WHERE observ LIKE "%Hola%">
> What is the syntax in Informix?
>
> My Informix Engine version is 7.31 in NT Server 4, Service Pack 5.
This is standard SQL and supported by Informix as is. There is an
equivalent Informix specific syntax in addition which is a bit more powerful
as it accepts a subset of regular expressions in addition to the two
wildcards that LIKE accepts:
SELECT *
FROM costumer
WHERE observ MATCHES "*Hola*";
MATCHES uses '*' where LIKE uses '%'
MATCHES uses '?' where LIKE users '_'
MATCHES uses '[a-z]' and LIKE has no equivalent
RTFineM - Guide to SQL: Reference
OOOPPPSSS!!!!
Oh wait, did you say a TEXT field as in a BLOB? Sorry no can search in a
BLOB of type TEXT or DATA. If you have IDS.2000 (9.2x) you can search in
CLOBs or using a text datablade such as Excaliber.
Art S. Kagel