Paste into Teradata using R JDBC

I am using R JDBC and teradataR to connect R to teradata. I would like to write a table using the dbWriteTable function, but I get this error

[Error 3932] [SQLState 25000] Only an ET or null statement is legal after a DDL statement.)

This works fine using RMySQL in a MySQL database.

There is a similar topic here, in which the problem was believed to be the lack of a “transaction start", but it turned out that this is not the case http://forums.teradata.com/forum/extensibility/teradata-r-create-table-based -on-a-data-frame-using-jdbc

+4
source share
1 answer

If you use the DDL statement with DML statements during parallel execution (semicolon on the next line) or in ANSI mode, and the DDL statement is not the last statement in the block, you will get this error.

select * from employee ;create table dept as select * from tmp_dept with no data ;update table employee set name = 'abc' where id = 101; 

As you noticed, DDL will lead to implicit commits; while in a transaction either the entire transaction is completed or rolled back. I think you now have an intuition. Check if the DDL code removes and solves the problem only with DML.

0
source

Source: https://habr.com/ru/post/1482061/


All Articles