Multiple DDL statements receives syntax error

Database

Multiple DDL statements receives syntax error

Hello,

I have whittled my example down to the following case that produces an error:

DATABASE test;

CREATE TABLE BUSINESS_UNIT_DIMENSION
(
BUSINESS_UNIT_KEY NUMERIC(22,0) NOT NULL,
PRIMARY KEY (BUSINESS_UNIT_KEY)
);

;CREATE TABLE DATE_DIMENSION
(
DATE_KEY NUMERIC(22,0) NOT NULL,
PRIMARY KEY (DATE_KEY)
);

I get the following error when running this in a query window from Teradata Administrator:
3932: Only an ET or null statement is legal after a DDL statement

There must be some trick to running multiple DDL statements in batch, but I am unable to figure out what it is. Both of these statements work fine in isolation. What is the secret I'm missing in Teradata's multi-command syntax?

Thanks so much for your help.

Matt Warden
Balanced Insight, Inc.
http://www.balancedinsight.com/
2 REPLIES

Re: Multiple DDL statements receives syntax error

I'm not familiar with Teradata Administrator, but I can reproduce your error in Teradata SQL Assistant. This is happening because you're executing the statements in parallel.

Try running this in SQL Assistant by doing a normal execution (F5) rather than executing in parallel (F9).

Re: Multiple DDL statements receives syntax error

Thank you. I was assuming it was a syntax problem, because that's what the error sounded like, so I would have never figured this out. There is no serial vs. parallel execution option that I can find in Administrator's query tool.

Thanks so much for your help!

Matt Warden
Balanced Insight, Inc.
http://www.balancedinsight.com/