How to use like expression in TIBCO BusinessEvents Query Language (BQL)

How to use like expression in TIBCO BusinessEvents Query Language (BQL)

book

Article ID: KB0089025

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Description:
How to use the LIKE operator in TIBCO BusinessEvents Query Language (BQL)

NOTE:
select symbol from /ConceptModel/StockTick where symbol like "T*" does not work (TIBX not returned)

Issue/Introduction

How to use like expression in TIBCO BusinessEvents Query Language (BQL)

Resolution

The syntax for the LIKE operator is Java RegEx and not the typical RDBMS % and ? symbols.

Example:

#select symbol from /ConceptModel/StockTick where symbol like ".*T.*"

TIBX
TIBX
MSFT
MSFT
MSFT

#select symbol from /ConceptModel/StockTick where symbol like ".*T"

MSFT
MSFT
MSFT

#select symbol from /ConceptModel/StockTick where symbol like "TIB"

-Nil-

#select symbol from /ConceptModel/StockTick where symbol like "TIB."

TIBX
TIBX
TIBX

#select symbol from /ConceptModel/StockTick where symbol like ".*"

JNJ
VMW
TIBX
HPQ
MSFT
VMW
HPQ
HPQ

   

Additional Information

RegEx expressions:
http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html