Only an ET or null statement is legal after a DDL Statement

Database

Only an ET or null statement is legal after a DDL Statement

Iam trying to execute the following following webfocus code using teradata SQL pass thru

ENGINE SQLDBC SET DEFAULT_CONNECTION &&IBCTDCONT
SQL SQLDBC
CREATE VOLATILE MULTISET TABLE KPIMMT
(
PERIOD INTEGER,
CR_BAND VARCHAR(20),
P_F INTEGER,
P_M INTEGER,
C_F INTEGER,
C_M INTEGER
)
ON COMMIT PRESERVE ROWS;
END
-RUN
SQL SQLDBC
INSERT INTO KPIMMT VALUES(1,'A',1,1,1,1);
END
-RUN

but am facing the following error
(FOC1400) SQLCODE IS -3932 (HEX: FFFFF0A4)
: [25000] [NCR][ODBC Teradata][Teradata Database] Only an ET or null state
: ment is legal after a DDL Statement.Unable to get catalog string.
(FOC1414) EXECUTE IMMEDIATE ERROR

How should the SQL be restructured to insert an ET or null statement after the create volatile statement??

Any assistance is highly appreciated
2 REPLIES
Enthusiast

Re: Only an ET or null statement is legal after a DDL Statement

Evidently, Webfocus is using ODBC in "manual commit mode". This mode expects the application to call a certain ODBC function (SQLTransact, if memory serves) to commit the transaction, and the Teradata ODBC driver will then generate the "ET" to the Teradata server. You'll need to find out from the Webfocus documentation how it do a transaction commit with its SQL passthru mode.

Re: Only an ET or null statement is legal after a DDL Statement

Hi,

Teradata session is available in two modes

1) BTET (Begin transaction, End transaction)

2) ANSI

BTET is implicit commit mode that is it doesn't require an explicit commit to commit the changes to the DB and ANSI is explicit commit mode.

Solutions

1) Please check the mode you are using it should be BTET

2) You could also try putting in a NULL statement in between the DDL and the DML by putting in an empty ; or key in an explicit 'ET' statement.