use of org.teiid.query.sql.util.VariableContext in project teiid by teiid.
the class DependentProcedureAccessNode method open.
@Override
public void open() throws TeiidComponentException, TeiidProcessingException {
CommandContext context = getContext().clone();
context.pushVariableContext(new VariableContext());
this.setContext(context);
DependentProcedureExecutionNode.shareVariableContext(this, context);
super.open();
}
use of org.teiid.query.sql.util.VariableContext in project teiid by teiid.
the class AssignmentInstruction method process.
/**
* <p> Updates the current variable context with a value for the Variable
* defined using a DeclareInstruction, the variable value is obtained by either processing
* a expression or a command(stored as a processplan). The Processing of the command is
* expected to result in 1 column, 1 row tuple, if more than a row is returned an exception
* is thrown. Also updates the program counter.</p>
* @throws BlockedException
* @throws TeiidComponentException if error processing command or expression on this instruction
*/
public void process(ProcedurePlan procEnv) throws BlockedException, TeiidComponentException, TeiidProcessingException {
VariableContext varContext = procEnv.getCurrentVariableContext();
Object value = null;
if (this.expression != null) {
value = procEnv.evaluateExpression(this.expression);
}
varContext.setValue(getVariable(), value);
LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { // $NON-NLS-1$
this.toString() + " The variable " + getVariable() + " in the variablecontext is updated with the value :", // $NON-NLS-1$
value });
}
Aggregations