Package org.teiid.dqp.internal.datamgr

Examples of org.teiid.dqp.internal.datamgr.ProcedureBatchHandler


    int total_columns = 3;
    StoredProcedure command = (StoredProcedure)helpGetCommand("{call pm2.spTest8(?)}", EXAMPLE_BQT); //$NON-NLS-1$     
    command.getInputParameters().get(0).setExpression(new Constant(1));
    Call proc = (Call)new LanguageBridgeFactory(EXAMPLE_BQT).translate(command);

    ProcedureBatchHandler pbh = new ProcedureBatchHandler(proc, exec);

    assertEquals(total_columns, pbh.padRow(Arrays.asList(null, null)).size());

    List params = pbh.getParameterRow();
   
    assertEquals(total_columns, params.size());
    // check the parameter value
    assertEquals(Integer.valueOf(0), params.get(2));

    try {
      pbh.padRow(Arrays.asList(1));
      fail("Expected exception from resultset mismatch"); //$NON-NLS-1$
    } catch (TranslatorException err) {
      assertEquals(
          "Could not process stored procedure results for EXEC spTest8(1).  Expected 2 result set columns, but was 1.  Please update your models to allow for stored procedure results batching.", err.getMessage()); //$NON-NLS-1$
    }
View Full Code Here

TOP

Related Classes of org.teiid.dqp.internal.datamgr.ProcedureBatchHandler

Copyright © 2018 www.massapicom. 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.