Examples of RaiseErrorStatement


Examples of org.teiid.query.sql.proc.RaiseErrorStatement

            }
            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;
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

        query.setFrom(from);
        helpTest("SELECT X.A FROM ((exec proc1('param1'))) AS X", "SELECT X.A FROM (EXEC proc1('param1')) AS X", query); //$NON-NLS-1$ //$NON-NLS-2$
    }   
   
    @Test public void testErrorStatement() throws Exception {
        RaiseErrorStatement errStmt = new RaiseErrorStatement(new Constant("Test only")); //$NON-NLS-1$
                
        helpStmtTest("ERROR 'Test only';", "ERROR 'Test only';", //$NON-NLS-1$ //$NON-NLS-2$
            errStmt);          
    }
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

  }
 
  // ################################## TEST HELPERS ################################ 

  public static final RaiseErrorStatement sample1() {
    return new RaiseErrorStatement(new Constant("a")); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

  public static final RaiseErrorStatement sample1() {
    return new RaiseErrorStatement(new Constant("a")); //$NON-NLS-1$
  }
 
  public static final RaiseErrorStatement sample2() {
    return new RaiseErrorStatement(new Constant("b")); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

  }
 
  // ################################## ACTUAL TESTS ################################ 
 
  public void testSelfEquivalence(){
    RaiseErrorStatement s1 = sample1();
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, s1, s1);
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, s1, s1);
  }

  public void testEquivalence(){
    RaiseErrorStatement s1 = sample1();
    RaiseErrorStatement s1a = sample1();
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, s1, s1a);
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, s1, s1a);
  }
 
  public void testNonEquivalence(){
    RaiseErrorStatement s1 = sample1();
    RaiseErrorStatement s2 = sample2();
    int equals = -1;
    UnitTestUtil.helpTestEquivalence(equals, s1, s2);
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

    DeclareStatement dclStmt = new DeclareStatement(new ElementSymbol("a"), "String"); //$NON-NLS-1$ //$NON-NLS-2$
    helpTest(dclStmt, "DECLARE String a;"); //$NON-NLS-1$
    }

    public void testRaiseErrorStatement() {
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
    helpTest(errStmt, "ERROR 'My Error';"); //$NON-NLS-1$
   
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
    helpTest(errStmt, "ERROR 'My Error';"); //$NON-NLS-1$
   
   
    public void testRaiseErrorStatementWithExpression() {
        RaiseErrorStatement errStmt =   new RaiseErrorStatement(new ElementSymbol("a")); //$NON-NLS-1$
        helpTest(errStmt, "ERROR a;"); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.query.sql.proc.RaiseErrorStatement

    public void testBlock1() {
        Delete d1 = new Delete();
        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);
    helpTest(b, "BEGIN\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.