8 Replies Latest reply on May 11, 2012 12:01 PM by Vineela Gampa

    Problem with creating temporary tables explicit way

    Vineela Gampa Novice

      Iam trying to create temporary tables using explicit syntax. Below is the code used to creat the same. However iam getting exception during inserts to that temp table.Am i missing anything here. I followed the documentation from http://docs.jboss.org/teiid/7.6.0.Final/reference/en-US/html/ddl_support.html#temp_tables

      http://docs.jboss.org/teiid/7.6.0.Final/reference/en-US/html/ddl_support.html#temp_tables

       

      try

              {

                 

                dbExecutor.execute("CREATE LOCAL TEMPORARY TABLE TEMP(zip string,phone string,name string,userid string,sysid string)");

                  List<Object> values = new ArrayList<>();

                  values.add("zip 1");

                  values.add("phone 1");

                  values.add("name 1");

                  values.add("userid 1");

                  values.add("sysod 1");

                  dbExecutor.addBatch("INSERT INTO #TEMP(zip,phone,name,userid,sysid) VALUES(?,?,?,?,?)",

                                      values);

                  dbExecutor.commit();

              } catch (final SQLException e)

              {

                  // TODO Auto-generated catch block

                  e.printStackTrace();

              } catch (Exception e)

              {

                  // TODO Auto-generated catch block

                  e.printStackTrace();

              }

       

      Caused by: [QueryResolverException] ERR.015.008.0026: Error Code:ERR.015.008.0026 Message:Expression 'INSERT INTO #hdvpWdhl (zip, phone, name, userid, sysid) VALUES (?, ?, ?, ?, ?)' has a parameter with non-determinable type information.  The use of an explicit convert may be necessary.

          at org.teiid.query.resolver.util.ResolverUtil.setDesiredType(ResolverUtil.java:313)

          at org.teiid.query.resolver.command.InsertResolver.resolveTypes(InsertResolver.java:184)

          at org.teiid.query.resolver.command.InsertResolver.resolveProceduralCommand(InsertResolver.java:120)

          at org.teiid.query.resolver.ProcedureContainerResolver.resolveCommand(ProcedureContainerResolver.java:140)

          at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:294)

          at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:147)

          at org.teiid.dqp.internal.process.Request.resolveCommand(Request.java:291)

          at org.teiid.dqp.internal.process.PreparedStatementRequest.resolveCommand(PreparedStatementRequest.java:87)

          at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:392)

          at org.teiid.dqp.internal.process.PreparedStatementRequest.generatePlan(PreparedStatementRequest.java:138)

          at org.teiid.dqp.internal.process.Request.processRequest(Request.java:459)

          at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:516)

          at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:276)

          at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:49)

          at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:215)

          at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:232)

          at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:118)

          at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:288)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)