SQL Script multiple statements in Teradata connection

cronos003
Level 2
SQL Script multiple statements in Teradata connection
Jump to solution

I'm trying to create a SQL script that has two statements: 1) Calling procedure that drops a table if it exists 2) Creating a new table



I'm getting " [Error 3932] [SQLState 25000] Only an ET or null statement is legal after a DDL Statement." which suggests that DSS is submitting the statements as Multi-Statement Request rather than as Single-Statement Request.  I am able to submit the query in SQL Assistant without error 



I tried including the DSS comment string to force splitting but I still get the error. 



I also tried setting TMODE = TERA advanced JDBC properties for the connection profile.



 




CALL ssd_pnr.conditional_drop('db_name', 'tbl_name', outmsg);

-- DKU_END_STATEMENT


CREATE
SET
TABLE db_name.tbl_name,
NO FALLBACK,
NO BEFORE JOURNAL,
NO
AFTER
JOURNAL AS (
SELECT
dw_key
FROM
db_name.src_tbl_name

) WITH DATA PRIMARY INDEX (dw_key);


 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Clément_Stenac Dataiker
Dataiker
Re: SQL Script multiple statements in Teradata connection
Jump to solution
Hi,

Please try checking "Autocommit" in the Teradata connection settings - ignore the warning saying that it's not recommended

View solution in original post

2 Replies
Highlighted
Clément_Stenac Dataiker
Dataiker
Re: SQL Script multiple statements in Teradata connection
Jump to solution
Hi,

Please try checking "Autocommit" in the Teradata connection settings - ignore the warning saying that it's not recommended

View solution in original post

Highlighted
cronos003
Level 2
Author
Re: SQL Script multiple statements in Teradata connection
Jump to solution
Thanks it works now.
0 Kudos
Labels (2)