Description
An new utility function has been added.
EVALUATE(statement[,params])
Arguments:
statement
String containing the statement to evaluate.
params
The statement parameters as either:
- An object containing named parameters
- An array containing positional parameters
The statement is evaluated with the same rights as the invoking statement. The results are an array and can be used anywhere an array is permitted in a statement. The statement must be read-only (error 5010, "not a readonly request" raised if not).
CAUTION: The results are materialised in memory so large result sets will have large memory requirements. Request quota may be used to constrain memory use (the evaluated statement operates within the invoking statement's quota).
Examples:
SELECT evaluate("SELECT $named_param AS example",{"named_param":"This is the named parameter's value"}) eval_result;
|
...
|
"results": [
|
{
|
"eval_result": [
|
{
|
"example": "This is the named parameter's value"
|
}
|
]
|
}
|
],
|
...
|
SELECT `Flavor` FROM evaluate("INFER `travel-sample`")[0] inf;
|
...
|
"results": [
|
{
|
"Flavor": "`type` = \"airport\""
|
},
|
{
|
"Flavor": "`stops` = 0, `type` = \"route\""
|
},
|
{
|
"Flavor": "`type` = \"landmark\""
|
},
|
{
|
"Flavor": "`type` = \"hotel\""
|
},
|
{
|
"Flavor": "`type` = \"airline\""
|
}
|
],
|
...
|
Attachments
Issue Links
- is caused by
-
MB-46928 Add an SQL++ function that can execute a statement in a string and provide the output
- Resolved