jdbc - Multiple Teradata DDL queries plus a select using Java -


may me on that?

i trying execute following query using java (teradata jdbc driver):

connection string:jdbc:teradata:/xxx.xx.xx.xx/database=xxx,tmode=tera,charset=utf8

jdbc driver:com.teradata.jdbc.teradriver

bt; create multiset volatile table (    select ... ) data  primary index (xxx, xxx) on commit preserve rows;  create multiset volatile table b (    select ... ) data  primary index (xxx, xxx) on commit preserve rows;  create multiset volatile table c (    select ... ) data  primary index (xxx, xxx) on commit preserve rows;  select x.a, x.b, x.c join a, b, c et; 

but getting following error message:

exception in thread "main" java.sql.sqlexception: [teradata database] [terajdbc 15.10.00.05] [error 3932] [sqlstate 25000] **only et or null statement legal after ddl statement.** @ com.teradata.jdbc.jdbc_4.util.errorfactory.makedatabasesqlexception(errorfactory.java:308) @ com.teradata.jdbc.jdbc_4.statemachine.receiveinitsubstate.action(receiveinitsubstate.java:109) @ com.teradata.jdbc.jdbc_4.statemachine.statementreceivestate.substatemachine(statementreceivestate.java:307) @ com.teradata.jdbc.jdbc_4.statemachine.statementreceivestate.action(statementreceivestate.java:196) @ com.teradata.jdbc.jdbc_4.statemachine.statementcontroller.runbody(statementcontroller.java:123) @ com.teradata.jdbc.jdbc_4.statemachine.statementcontroller.run(statementcontroller.java:114) @ com.teradata.jdbc.jdbc_4.tdstatement.executestatement(tdstatement.java:386) @ com.teradata.jdbc.jdbc_4.tdstatement.executestatement(tdstatement.java:328) @ com.teradata.jdbc.jdbc_4.tdstatement.dononprepexecutequery(tdstatement.java:316) @ com.teradata.jdbc.jdbc_4.tdstatement.executequery(tdstatement.java:1105) @ datacolector.datacolector.getresultset(datacolector.java:55) @ cmaestro.getcsvfile(cmaestro.java:1539) @ cmaestro.run(cmaestro.java:125) @ cmaestro.main(cmaestro.java:152) 

any idea?

thanks

in teradata each ddl statement must committed, there's no way run multiple create table within same transaction.

you must remove bt/et.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -