有人可以帮助我吗?
我正在尝试使用Java(Teradata JDBC驱动程序)执行以下查询:
连接字符串:jdbc:teradata:/xxx.xx.xx.xx/database=XXX,tmode=TERA,charset=UTF8
JDBC驱动程序:com.teradata.jdbc.TeraDriver
BT;
create MULTISET VOLATILE table A as (
select ...
) WITH DATA primary index (xxx, xxx) on commit preserve rows;
create MULTISET VOLATILE table B as (
select ...
) WITH DATA primary index (xxx, xxx) on commit preserve rows;
create MULTISET VOLATILE table C as (
select ...
) WITH DATA primary index (xxx, xxx) on commit preserve rows;
select x.A, x.B, x.C from join A, B, C
ET;
但是我收到以下错误消息:
Exception in thread "main" java.sql.SQLException: [Teradata Database] [TeraJDBC 15.10.00.05] [Error 3932] [SQLState 25000] **Only an ET or null statement is legal after a DDL Statement.**
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:308)
at com.teradata.jdbc.jdbc_4.statemachine.ReceiveInitSubState.action(ReceiveInitSubState.java:109)
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateMachine(StatementReceiveState.java:307)
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:196)
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:123)
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:114)
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:386)
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:328)
at com.teradata.jdbc.jdbc_4.TDStatement.doNonPrepExecuteQuery(TDStatement.java:316)
at com.teradata.jdbc.jdbc_4.TDStatement.executeQuery(TDStatement.java:1105)
at dataColector.DataColector.getResultSet(DataColector.java:55)
at CMaestro.getCSVFile(CMaestro.java:1539)
at CMaestro.run(CMaestro.java:125)
at CMaestro.main(CMaestro.java:152)
任何想法?
感谢
答案 0 :(得分:1)
在Teradata中,必须提交每个DDL语句,无法在同一事务中运行多个CREATE TABLE
。
您必须删除BT
/ ET
。