Package org.teiid.query.sql.proc

Examples of org.teiid.query.sql.proc.Block.addStatement()


      CommandStatement cmdStmt =  new CommandStatement(d1);
      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block ifblock = new Block();
      ifblock.addStatement(cmdStmt);
      ifblock.addStatement(assigStmt);
      ifblock.addStatement(errStmt);

    // construct If criteria     
    ElementSymbol sy1 = new ElementSymbol("x"); //$NON-NLS-1$
    List elmnts = new ArrayList(1);
View Full Code Here


      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block ifblock = new Block();
      ifblock.addStatement(cmdStmt);
      ifblock.addStatement(assigStmt);
      ifblock.addStatement(errStmt);

    // construct If criteria     
    ElementSymbol sy1 = new ElementSymbol("x"); //$NON-NLS-1$
    List elmnts = new ArrayList(1);
    elmnts.add(sy1);
View Full Code Here

    elmnts.add(sy1);
    CriteriaSelector cs = new CriteriaSelector(CriteriaSelector.LIKE, elmnts);     
      Criteria crit = new HasCriteria(cs);
     
      Block elseblock = new Block();
      elseblock.addStatement(cmdStmt);
     
      IfStatement ifStmt = new IfStatement(crit, ifblock, elseblock);
    helpTest(ifStmt, "IF(HAS LIKE CRITERIA ON (x))\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND\nELSE\nBEGIN\nDELETE FROM g;\nEND"); //$NON-NLS-1$
    }   
View Full Code Here

        d1.setGroup(new GroupSymbol("g")); //$NON-NLS-1$
      CommandStatement cmdStmt =  new CommandStatement(d1);
      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block b = new Block();
      b.addStatement(cmdStmt);
      b.addStatement(assigStmt);
      b.addStatement(errStmt);
      CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(b);
    helpTest(cup, "CREATE PROCEDURE\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND");       //$NON-NLS-1$
    }
View Full Code Here

      CommandStatement cmdStmt =  new CommandStatement(d1);
      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block b = new Block();
      b.addStatement(cmdStmt);
      b.addStatement(assigStmt);
      b.addStatement(errStmt);
      CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(b);
    helpTest(cup, "CREATE PROCEDURE\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND");       //$NON-NLS-1$
    }
   
View Full Code Here

      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block b = new Block();
      b.addStatement(cmdStmt);
      b.addStatement(assigStmt);
      b.addStatement(errStmt);
      CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(b);
    helpTest(cup, "CREATE PROCEDURE\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND");       //$NON-NLS-1$
    }
   
    public void testCreateUpdateProcedure2() {
View Full Code Here

        d1.setGroup(new GroupSymbol("g")); //$NON-NLS-1$
      CommandStatement cmdStmt =  new CommandStatement(d1);
      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block b = new Block();
      b.addStatement(cmdStmt);
      b.addStatement(assigStmt);
      b.addStatement(errStmt);
      CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(b);
    helpTest(cup, "CREATE PROCEDURE\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND");       //$NON-NLS-1$
    }
View Full Code Here

      CommandStatement cmdStmt =  new CommandStatement(d1);
      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block b = new Block();
      b.addStatement(cmdStmt);
      b.addStatement(assigStmt);
      b.addStatement(errStmt);
      CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(b);
    helpTest(cup, "CREATE PROCEDURE\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND");       //$NON-NLS-1$
    }
View Full Code Here

      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block b = new Block();
      b.addStatement(cmdStmt);
      b.addStatement(assigStmt);
      b.addStatement(errStmt);
      CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(b);
    helpTest(cup, "CREATE PROCEDURE\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND");       //$NON-NLS-1$
    }

    public void testCreateUpdateProcedure3() {
View Full Code Here

        d1.setGroup(new GroupSymbol("g")); //$NON-NLS-1$
      CommandStatement cmdStmt =  new CommandStatement(d1);
      AssignmentStatement assigStmt =  new AssignmentStatement(new ElementSymbol("a"), new Constant(new Integer(1))); //$NON-NLS-1$
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block b = new Block();
      b.addStatement(cmdStmt);
      b.addStatement(assigStmt);
      b.addStatement(errStmt);
      CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(b);
    helpTest(cup, "CREATE PROCEDURE\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND");       //$NON-NLS-1$
    }
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.