Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

Connectivity
N/A

Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

Hi,

I can establish the connection just fine.... 

My connection statement:

jdbcCon <- dbConnect(drv = JDBC("com.teradata.jdbc.TeraDriver"),user = UID, password = PWD, 

paste("jdbc:teradata://",DSN,"/database=",DataBase, ",TMODE=TERA,CHARSET=UTF8", sep = ""))

assign("tdConnection", jdbcCon, envir = .GlobalEnv)

I can read perfect, but when trying to write I get the following error:

dbWriteTable(conn = tdConnection, name = "DWSP_ETL_STG.subtest", value = subtest, row.names = F,  overwrite = T, append = F)

Error in .verify.JDBC.result(s, "Unable to execute JDBC statement ", statement) : 

  Unable to execute JDBC statement INSERT INTO DWSP_ETL_STG.subtest VALUES(?,?,?,?,?,?,?); ([Teradata Database] [TeraJDBC 14.00.00.21] [Error 3932] [SQLState 25000] Only an ET or null statement is legal after a DDL Statement.)

I get the same error when running the wrapper function from the TeradataR package "as.td.data.frame"

as.td.data.frame(x = subtest, tableName = "DWSP_ETL_STG.subtest", database = "DWSP_ETL_STG")

Error in .verify.JDBC.result(s, "Unable to execute JDBC statement ", statement) : 

  Unable to execute JDBC statement INSERT INTO subtest VALUES(?,?,?,?,?,?,?); ([Teradata Database] [TeraJDBC 14.00.00.21] [Error 3932] [SQLState 25000] Only an ET or null statement is legal after a DDL Statement.)

BTW,  when using the RODBC to establish the connection I am able to write to the db just fine.   I am trying to use/test JDBC in search of better performance. 

Can someone help?

Thanks

Daniel J Celta

7 REPLIES

Re: Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

Has this been resolved? I'm encountering the same issue.

Re: Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

same problem!

N/A

Re: Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

Any updates to this issue? I get the same error and as Daniel, I was trying to use jdbc to get better performance in writing R data.frames to teradata.

Teradata Employee

Re: Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

Please refer to Andreas Marek's blog http://developer.teradata.com/blog/amarek for examples of how to use the Teradata JDBC Driver with R.

Re: Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

That is not a solution - it's a workaround which requires an hour of manual work... when is Teradata going to fix this?

N/A

Re: Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

4 years later....... Any solution yet?

Teradata Employee

Re: Using RJDBC and connected successfully, I get errors when trying to write using "as.td.data.frame" or "dbWriteTable"...

@jknife What problem are you encountering? Please post details of your code and what error you are seeing.