It can be beneficial, in some cases, to evaluate a variable only once, at creation, instead of every time it is referenced.

Use *= to force Connect to evaluate a variable expression immediately, when setting the variable.

In this example, we SET the v_period_name variable, and use *= to force Connect to resolve its value in the same statement:  

 

1 SQL> set v_period_name *= select LookupPeriodName(ToDate(min(incentive_date)), ‘monthly’) from xactly.xc_order_stage where incentive_date between ToDate(‘2016-01-01’, ‘yyyy-MM-dd’) and ToDate(‘2016-01-31’, ‘yyyy-MM-dd’);

Screen Shot 2016-06-06 at 11.30.29 AM

If we had omitted the * from the statement above, the :v_period_name expression would be evaluated for every row:

 

1 SQL> select count(*) from xactly.xc_payment where period_name = :v_period_name;

Screen Shot 2016-06-06 at 11.30.39 AM