Over the years, I’ve noticed that certain SQL questions come up repeatedly on the InterSystems Developer Community, especially about using the LIKE
predicate in different contexts. Common variations include:
and many more derivatives. So, I decided to write an article that focuses on how LIKE
works in InterSystems IRIS SQL, especially when used with variables in Embedded SQL, Dynamic SQL, and Class Queries, while touching on pattern escaping, special character searches, and security best practices.

First of all, I'd like to mention that InterSystems IRIS SQL offers most of the capabilities available in other relational DBMS that implement a later version of the SQL standard. But at the same time, it's important to mention that apart from relational access, in IRIS you can also use other models to get the same data, for example, object or document models.
On this note, let's look at the LIKE
predicate and how this tool is used in SQL for pattern matching.