Open topic with navigation

TIBCO® Patterns 6.1.2

# Filtering with Predicates

A predicate (or predicate expression) is a logical expression similar to an SQL WHERE clause. By far the most common use of predicates in TIBCO Patterns is to filter the results of the search. Just as a WHERE clause can be used to limit the output of a SELECT command in SQL, a predicate expression can be used to limit the output of a search in TIBCO Patterns. Predicate expressions used in this way are called filtering predicates.

An example of a filtering predicate is given in Introduction, where the filtered results are based on the content of a STATE field, using the predicate expression:

$“STATE” = “CA”

Filtering predicates can only modify a search, not constitute it. That is, you cannot execute a search consisting only of a filtering predicate like `$“STATE” = “CA”` (to find all records in a table with “CA” as the value of the STATE field). Filtering predicates do not stand alone; they merely modify a search involving the usual simple or cognate query types.

Filtering predicates must be constructed so that the result of their evaluation is either true or false. (This is naturally accomplished through the use of the Boolean operators provided for predicate expressions.) Only records for which the predicate expression evaluates to true are returned by the search.

Filtering predicates are used when there is some specific exact match condition that can be used to eliminate a record from consideration. For example, if you are searching for vehicle registrations and looking for a commercial vehicle, you can use a filtering predicate that selects only commercial registrations. If, however, the criteria cannot be guaranteed to eliminate a record from consideration, you cannot use a filtering predicate. In the example from the Introduction, if there was a significant probability that the STATE field could have an incorrect value, then filtering based on the STATE field would not be valid as you could have some matching records with incorrect STATE values that would be eliminated by the filtering predicate.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO® Patterns

Copyright © 2010-2025. Cloud Software Group, Inc. All Rights Reserved.