SqlRuleAction.SqlExpression Property
Gets the SQL expression.
Namespace: Microsoft.ServiceBus.Messaging
Assembly: Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
Note |
|---|
Only alphanumeric characters and a dot character (".") are supported for filter names at this time |
The SQL grammar is as follows:
<statements> ::= <statement> [, ...n] <statement> ::= <action> [;]
The semicolon is optional.
<action> ::=
SET <property> = <expression>
REMOVE <property>
<expression> ::=
<literal>
| <function> ::=
newid()
| <property>
| <expression> { + | - | * | / } <expression>
| { + | - } <expression>
| ( <expression> )
Remarks
newid() is used to generate a Guid. The function calls the System.Guid.NewGuid method to generate.
Syntax
<property> := [<scope> .] <property_name>
Arguments
An attempt to access a non-existing system property is an error, while an attempt to access a non-existing user property is not an error. Instead, the non-existing user property is evaluated as an unknown value. An unknown value is treated specially during operator evaluation.
Syntax
<property_name> ::= <property_name_part> <scope> ::= <property_name_part> <property_name_part> ::= <identifier> | <delimited_identifier> <identifier> ::= <regular_identifier> | <quoted_identifier> | <delimited_identifier>
Arguments
Syntax
<constant> ::= <long_constant> | <double_constant> | <boolean_constant> | NULL <constant> ::= <integer_constant> | <decimal_constant> | <approximate_number_constant> | <boolean_constant> | NULL
Arguments
<boolean_constant> := TRUE | FALSE
Boolean constants are represented by keyword TRUE or FALSE. The values are stored as System.Boolean.
<string_constant>
String constants are enclosed in single quotation marks and include any valid Unicode characters. A single quotation mark embedded in a string constant is represented as two single quotation marks.
Consider the following semantics in the language:
SET is used to create a new property or update the value of an existing property.
REMOVE is used to remove a property.
SET performs implicit conversion, if possible, when the expression type and the existing property type are different.
The action fails if non-existing system properties are referenced.
The action does not fail if non-existing user properties are referenced.
A non-existing user property is evaluated as "Unknown" and follows the same semantic as SqlFilter when evaluating operators.
The NEWID() function is used to return a new GUID string literal in a rule action. You can expect the value to become a string if you have an existing string property on the left side of your assignment operator in the rule action via implicit conversion as mentioned above.
Note