AssignmentStatement assignStmt = (AssignmentStatement)statement;
assignInstr.setVariable(assignStmt.getVariable());
Expression asigExpr = assignStmt.getExpression();
assignInstr.setExpression(asigExpr);
if(debug) {
analysisRecord.println("\tASSIGNMENT\n" + statement); //$NON-NLS-1$
}
break;
}
case Statement.TYPE_ERROR:
{
ErrorInstruction error = new ErrorInstruction();
instruction = error;
RaiseErrorStatement res = (RaiseErrorStatement)statement;
Expression asigExpr = res.getExpression();
error.setExpression(asigExpr);
if(debug) {
analysisRecord.println("\tERROR STATEMENT:\n" + statement); //$NON-NLS-1$
}
break;
}
case Statement.TYPE_COMMAND:
{
CommandStatement cmdStmt = (CommandStatement) statement;
Command command = cmdStmt.getCommand();
ProcessorPlan commandPlan = cmdStmt.getCommand().getProcessorPlan();
if (command.getType() == Command.TYPE_DYNAMIC){
instruction = new ExecDynamicSqlInstruction(parentProcCommand,((DynamicCommand)command), metadata, idGenerator, capFinder );
}else{
instruction = new CreateCursorResultSetInstruction(CreateCursorResultSetInstruction.RS_NAME, commandPlan,
command.getType() == Command.TYPE_INSERT
|| command.getType() == Command.TYPE_UPDATE
|| command.getType() == Command.TYPE_DELETE);
//handle stored procedure calls
if (command.getType() == Command.TYPE_STORED_PROCEDURE) {
StoredProcedure sp = (StoredProcedure)command;
if (sp.isCallableStatement()) {
Map<ElementSymbol, ElementSymbol> assignments = new LinkedHashMap<ElementSymbol, ElementSymbol>();
for (SPParameter param : sp.getParameters()) {
if (param.getParameterType() == SPParameter.RESULT_SET
|| param.getParameterType() == SPParameter.IN) {
continue;
}
Expression expr = param.getExpression();
if (expr instanceof Reference) {
expr = ((Reference)expr).getExpression();
}
ElementSymbol symbol = null;
if (expr instanceof ElementSymbol) {