Examples of WhileInstruction


Examples of org.teiid.query.processor.proc.WhileInstruction

                WhileStatement whileStmt = (WhileStatement)statement;
                Program whileProgram = planBlock(parentProcCommand, whileStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context);
                if(debug) {
                  analysisRecord.println("\tWHILE STATEMENT:\n" + statement); //$NON-NLS-1$
                }
                instruction = new WhileInstruction(whileProgram, whileStmt.getCondition());
                break;
            }
      default:
            throw new QueryPlannerException(QueryPlugin.Util.getString("ProcedurePlanner.bad_stmt", stmtType)); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.query.processor.xml.WhileInstruction

        // Add instruction to read the first row in
        MoveCursorInstruction moveCursor = new MoveCursorInstruction(source);
        currentProgram.addInstruction(moveCursor);

        // set up while instruction, add sub Program
        WhileInstruction whileInst = new WhileInstruction(source);
        currentProgram.addInstruction(whileInst);
       
        Program childProgram = new Program();
        whileInst.setBlockProgram(childProgram);

        // when while is done close the resultset(note that the child program will
        // have all the statements.
        EndBlockInstruction closeInst = new EndBlockInstruction(source);
        currentProgram.addInstruction(closeInst);       
View Full Code Here

Examples of org.teiid.query.processor.xml.WhileInstruction

       
        for (int i = 0; i < program.getProcessorInstructions().size(); i++) {
            ProcessorInstruction inst = program.getInstructionAt(i);
           
            if (inst instanceof WhileInstruction) {
                WhileInstruction whileInst = (WhileInstruction)inst;
                childProgram = whileInst.getBlockProgram();
                getProgramStats(childProgram, map);
            }
            else if (inst instanceof IfInstruction) {
                IfInstruction ifInst = (IfInstruction)inst;
               
View Full Code Here

Examples of org.teiid.query.processor.xml.WhileInstruction

       
        ResultSetInfo info = new ResultSetInfo("xmltest.rs"); //$NON-NLS-1$
        ProcessorInstruction i7 = new ExecSqlInstruction("xmltest.rs", info);                 //$NON-NLS-1$
        ProcessorInstruction i8 = new MoveCursorInstruction("xmltest.rs"); //$NON-NLS-1$

        WhileInstruction i9 = new WhileInstruction("xmltest.rs");         //$NON-NLS-1$
        descriptor = NodeDescriptor.createNodeDescriptor("Item", null, AddNodeInstruction.ELEMENT, null, null, null,false, null, MappingNodeConstants.NORMALIZE_TEXT_PRESERVE);//$NON-NLS-1$
        ProcessorInstruction i10 = new AddNodeInstruction(descriptor);
        ProcessorInstruction i11 = new MoveDocInstruction(MoveDocInstruction.DOWN);
        descriptor = NodeDescriptor.createNodeDescriptor("ItemID", null, AddNodeInstruction.ATTRIBUTE, null, null, null, false, null, MappingNodeConstants.NORMALIZE_TEXT_PRESERVE);//$NON-NLS-1$
        ProcessorInstruction i12 = new AddNodeInstruction(descriptor, new ElementSymbol("xmltest.rs.itemNum")); //$NON-NLS-1$
        descriptor = NodeDescriptor.createNodeDescriptor("Name", null, AddNodeInstruction.ELEMENT, null, null, null, false, null, MappingNodeConstants.NORMALIZE_TEXT_PRESERVE);//$NON-NLS-1$
        ProcessorInstruction i13 = new AddNodeInstruction(descriptor, new ElementSymbol("xmltest.rs.itemName"));//$NON-NLS-1$
        descriptor = NodeDescriptor.createNodeDescriptor("Quantity", null, AddNodeInstruction.ELEMENT, null, null, null,false, null, MappingNodeConstants.NORMALIZE_TEXT_PRESERVE);//$NON-NLS-1$
        ProcessorInstruction i14 = new AddNodeInstruction(descriptor, new ElementSymbol("xmltest.rs.itemQuantity"));//$NON-NLS-1$
        ProcessorInstruction i15 = new MoveDocInstruction(MoveDocInstruction.UP);
        ProcessorInstruction i16 = new MoveCursorInstruction("xmltest.rs"); //$NON-NLS-1$

        ProcessorInstruction i17 = new MoveDocInstruction(MoveDocInstruction.UP);
        ProcessorInstruction i18 = new MoveDocInstruction(MoveDocInstruction.UP);
        ProcessorInstruction i19 = new MoveDocInstruction(MoveDocInstruction.UP);
       
        ProcessorInstruction i20 = new EndDocumentInstruction();
       
        // Stitch them together
       
        Program program = new Program();
        program.addInstruction(i0);
        program.addInstruction(i1);
        program.addInstruction(i2);
        program.addInstruction(i3);
        program.addInstruction(i4);
        program.addInstruction(i5);
        program.addInstruction(i6);
        program.addInstruction(i7);
        program.addInstruction(i8);
        program.addInstruction(i9);

        Program subProgram = new Program();
        i9.setBlockProgram(subProgram);
        subProgram.addInstruction(i10);
        subProgram.addInstruction(i11);
        subProgram.addInstruction(i12);
        subProgram.addInstruction(i13);
        subProgram.addInstruction(i14);
View Full Code Here

Examples of org.teiid.query.processor.xml.WhileInstruction

        ResultSetInfo info = new ResultSetInfo("xmltest.rs"); //$NON-NLS-1$
        ProcessorInstruction i7 = new ExecSqlInstruction("xmltest.rs", info);                 //$NON-NLS-1$
        ProcessorInstruction i8 = new MoveCursorInstruction("xmltest.rs"); //$NON-NLS-1$

        WhileInstruction i9 = new WhileInstruction("xmltest.rs");         //$NON-NLS-1$

        //need to move this up here so it can be referenced by "If" instruction
        ProcessorInstruction i17 = new MoveCursorInstruction("xmltest.rs"); //$NON-NLS-1$

        IfInstruction i10 = new IfInstruction( );
        descriptor = NodeDescriptor.createNodeDescriptor("Item", null, AddNodeInstruction.ELEMENT, null, null, null,false, null, MappingNodeConstants.NORMALIZE_TEXT_PRESERVE);//$NON-NLS-1$
        ProcessorInstruction i11 = new AddNodeInstruction(descriptor);
        ProcessorInstruction i12 = new MoveDocInstruction(MoveDocInstruction.DOWN);
        descriptor = NodeDescriptor.createNodeDescriptor("ItemID", null, AddNodeInstruction.ATTRIBUTE, null, null, null,false, null, MappingNodeConstants.NORMALIZE_TEXT_PRESERVE);//$NON-NLS-1$
        ProcessorInstruction i13 = new AddNodeInstruction(descriptor, new ElementSymbol("xmltest.rs.itemNum"));//$NON-NLS-1$
        descriptor = NodeDescriptor.createNodeDescriptor("Name", null, AddNodeInstruction.ELEMENT, null, null, null,false, null, MappingNodeConstants.NORMALIZE_TEXT_PRESERVE);//$NON-NLS-1$
        ProcessorInstruction i14 = new AddNodeInstruction(descriptor, new ElementSymbol("xmltest.rs.itemName"));//$NON-NLS-1$
        descriptor = NodeDescriptor.createNodeDescriptor("Quantity", null, AddNodeInstruction.ELEMENT, null, null, null,false, null, MappingNodeConstants.NORMALIZE_TEXT_PRESERVE);//$NON-NLS-1$
        ProcessorInstruction i15 = new AddNodeInstruction(descriptor, new ElementSymbol("xmltest.rs.itemQuantity")); //$NON-NLS-1$      
        ProcessorInstruction i16 = new MoveDocInstruction(MoveDocInstruction.UP);

        ProcessorInstruction i18 = new MoveDocInstruction(MoveDocInstruction.UP);
        ProcessorInstruction i19 = new MoveDocInstruction(MoveDocInstruction.UP);
        ProcessorInstruction i20 = new MoveDocInstruction(MoveDocInstruction.UP);
        ProcessorInstruction i21 = new EndDocumentInstruction();

       
        // Stitch them together

        Program program = new Program();
        program.addInstruction(i0);
        program.addInstruction(i1);
        program.addInstruction(i2);
        program.addInstruction(i3);
        program.addInstruction(i4);
        program.addInstruction(i5);
        program.addInstruction(i6);
        program.addInstruction(i7);
        program.addInstruction(i8);
        program.addInstruction(i9);

        Program whileProgram = new Program();
        i9.setBlockProgram(whileProgram);
        whileProgram.addInstruction(i10);

        Program thenProgram = new Program();
        Condition cond = new CriteriaCondition(crit, thenProgram);
        i10.addCondition(cond);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.