Summary
The EVAL
command explicitly evaluates the value of a variable or an XSQL expression.
Variables SET with ‘*=’ syntax are evaluated when set, not at run time with EVAL.
Syntax
eval <variable_name_or_expression>; |
Parameters
Parameter
|
Description
|
---|---|
<variable_name_or_expression> |
The variable or expression to evaluate. |
Details
XSQL expressions can also evaluate variables using the following methods:
- Within parentheses ()
- Using the colon
:
operator - Text substitution using {}. Variable string values used for text substitution must be less that 4 megabytes.
Examples
// The following eval examples assume the variables have been SET. eval v_now; eval 'hello' ; eval 1 + 2 * 10 ; eval variable2 || '-2015' ; eval Now(); eval Uppercase( 'this once was lowercase' ); // Variables can hold single values or table result sets. set v_result_set = select * from xactly.xc_period; select * from (eval v_result_set); // Evaluate using the ":" operator within XSQL. insert into delta.test_table (col1) values (:v_now); // Text substitution example within a SELECT. set col_list = 'participant_id, first_name, hire_date, effective_start_date, effective_end_date' ; select {:col_list} from xactly.xc_participant; |
Related Commands