All Forums Database
novice 38 posts Joined 07/07
20 Jan 2009
ANSI versus Teradata Mode Transactions

Hi,I have read that in ANSI mode a DDL statement should be followed immediately with a Commit statement. But in Teradata mode all the statements are implicitly commited or within a BT/ET.I am facing a strange situation. I logon to a bteq ( by deafult Teradata mode) and submit the below set of transactionsBT; INSERT INTO Databasename.DIM_TABLE ( Table_Key,Table_Name,Database_name,Environment_name ) VALUES ( 541,'T10128','EDWPRDE','ST'); -- DML-- 1 row added del from edwst1e_data_audit.dim_table where table_key = 541; -- DML -- 1 row removed Collect stats on Databasename.dim_table ; -- Completed ET; As you would expect everything goes smoothly but if we bring Collect stats before deleting the rows then it gives error BT; INSERT INTO Databasename.DIM_TABLE ( Table_Key,Table_Name,Database_name,Environment_name )VALUES ( 541,'T10128_','EDWPRDE','ST'); collect stats on Databasename.dim_table ; del from Databasename.dim_table where table_key = 541; Failure 3932 Only an ET or null statement is legal after a DDL Statement ET;Is Collecting stats a DDL statement? and is DATABASE/SET SESSION also considered a DDL?

joedsilva 505 posts Joined 07/05
20 Jan 2009

Yes they are treated like DDL statements.

You must sign in to leave a comment.