BQL Expressions

Back to BQL Overview

BQL Expressions are used in the where clause of a BQL query to further qualify a result by narrowing the set of objects in the extent.

Operator Precedence

BQL supports the following set of operators ordered by precedence:

!, not, -logical not, numeric negation
*, /multiplication, division
+, -addition, subtraction
=, !=, >, >=, <, <=
like, in
comparisons
and, orlogical operators

Parentheses can be used to override the normal precedence.

Typed Literals

All primitive types and BSimple types can be expressed as literals in BQL. The syntax for primitives types is:

String - single quoted string
Example: 'This is a string literal'

number - a numeric value, unquoted
Example: 10

boolean - true or false, unquoted
Example: true

enum - The enum type spec followed by the tag separated by a dot.
Example: alarm:SourceState.normal

Expressing other BSimple types in BQL is more verbose because a type specifier is required. The syntax for a BSimple value is the type spec (i.e. moduleName:typeName) followed by a string literal with the string encoding of the value (the result of encodeToString() for the type). Example: baja:RelTime '10000'

Baja types are expressed in BQL using the type spec. Any type spec that is not followed by a quoted string refers to the type itself.
Example: where out.type = baja:StatusNumeric