All Forums Connectivity
dcelta 1 post Joined 11/12
29 Nov 2012
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
 

Daniel J Celta
adam.edgley 1 post Joined 08/12
25 Jun 2013

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

martinbel 1 post Joined 12/13
14 Feb 2014

same problem!

murgai 1 post Joined 08/11
05 Jan 2015

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.

tomnolan 594 posts Joined 01/08
06 Jan 2015

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.

skunkwerk2 2 posts Joined 08/15
24 Aug 2015

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

jknife 1 post Joined 08/16
23 Aug 2016

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

tomnolan 594 posts Joined 01/08
24 Aug 2016

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

You must sign in to leave a comment.