SQL Variable
Description
Stores the result of a database query into a variable
Parameters
Name | Required | Default Value | Description |
---|---|---|---|
Name | Yes | Variable name | |
Data Source | Yes | Data source to query | |
Injected | Yes | false | If set to true, the body will have any '%prefix:keychain%' values injected with values from the current report item prior to being evaluated. |
Data Type | Yes | Table | Allows setting the data type of the variable to facilitate access later on. The type can be:
|
Examples
Read a row to a variable and report on it
{sql-variable:ds=myDB|injected=true|name=user|type=Row}
select *
from user
where username = '%page:title%'
{sql-variable}
{report-on:injected=true}
Name: %variable:user > row:name%
Email: %variable:user > row:email%
Phone: %variable:user > row:phone%
{report-on}