ECSql Conditional Expressions
ECSQL supports the following conditional expressions:
CASE-WHEN-THEN-ELSE
IIF()
CASE-WHEN-THEN-ELSE
ECSQL supports only searched CASE expressions:
Limitations
Only primitive type can be used with WHEN, THEN and ELSE. Primitive does not include p2d, p3d, IGometery and NavigationProperties. You can still use sub-queries that return single column and pretty much any SQL expressions.
Example
IIF ( condition-expr, true-expr , false-expr )
ECSQL supports IIF(), which is really shorthand for CASE WHEN <condition-expr> THEN <true-expr> ELSE <false-expr> END
Parameters
condition-expr
: A condition expression that resolve into a boolean value. e.g. Length > 1.0.
true-expr
: Value returned when the condition-expr
is evaluated to a true value.
false-expr
: Value returned when the condition-expr
is evaluated to a false value.
Example
Last Updated: 02 February, 2022