cancel
Showing results for 
Search instead for 
Did you mean: 

DQL expression for matching strings

Phil_Rosier
Level 4

I have a customer who requires a custom report for Data insight to filter out some of the records. I'm hoping to use DQL for this, but struggling to find an equivalent of the LIKE and NOT LIKE statement in SQL. The nearest thing I can find in the programmers SDK guide is a MATCH statement, however this is poorly documented and refers to an external site for more information which no-longer exists.

Does anyone have an example of using the MATCH statement, or know any other way of of achieving this other than extracting the raw data into a database file and writing a SQLite script to generate the report.  

Thanks
Phil

1 REPLY 1

Rishi_Thaper
Level 4
Employee

While we don't provide like statement. substr, substri, match and matchi functions can provide you the required functionality (Example below). While substring functions can hep you match strings, match function help in regular expression pattern matching.

Substri Example:
FROM user
GET user.name,
user.memberof.name,
isdisabled,
isdeleted
IF
substri(memberof.name,'GG_')=1
FORMAT user.memberof.name as CSV;

JFYI, In 4.5, we have added various DQL templates that can help in creation of customized DQL queries.