SQL
SQL is used to retrieve a value from the database using a query. The
SQL statement should be constructed to return one value. If
the results have more than one column and/or more than one row, only the
first column of the first row is fetched. The SQL query can have dynamic
items within its construct. These items take the form of [VariableName
].
VariableName can also include system
provided variables like PolicyGUID and SegmentGUID.
TYPE=SQL | |||
---|---|---|---|
Element | Attributes | Attribute Value | Element Value |
<MathVariable> |
TYPE |
SQL |
A SELECT statement. |
LOG |
Yes: the result is stored in AsActivityMath table to be used by other activities. No: result is not stored. This is the default behavior. |
||
DEFAULT |
Must be defined when the datatype of the SQL is integer or decimal. |
Best practice is to make your default value a value that will indicate you did not retrieve data as expected. Useful for debugging. |
XML Example
<MathVariable VARIABLENAME="RoleGUID" TYPE="SQL" DATATYPE="TEXT">SELECT AsRole.RoleGUID FROM AsRole</MathVariable>