30 Nov 2012
I was also not able to do it.
DBQL states that both operations dbWriteTable and as.td.data.frame start with an BT; before the CREATE table is executed.
And in this case the TMODE=TERA does not help as in explizit transaction was started.
So question is if someone ever had been able to load data via as.td.data.frame and JDBC???
feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud
Hi All,
I am trying a solve an ssue where creating a new table and inserting data that results in error such as this: [Error 3932] [SQLState 25000] Only an ET or null statement is legal after a DDL Statement.
The operation is very simple, we basically look at a set of data, massage it using R and try to insert back into a table.
Here are the sample script I modified from TD Exchange:
library(RJDBC)
library(teradataR)
tdConnect("123.123.123.123","hlim","password"," sys_calendar","jdbc")
tdf <- td.data.frame("calendar")
my.stats <- td.stats(tdf,"year_of_calendar", c("cnt","min","max","mean"))
dbWriteTable(conn = tdConnection, name = "DWSP_ETL_STG.testme", value = my.stats, row.names = F, overwrite = T, append = T)
The last line is the problem where Error 3932 occurs.
We tried the normal dbConnect method and put in TMODE=ANSI or TERA but that does not help either.
For example,
drv = JDBC("com.teradata.jdbc.TeraDriver","c:/teradatajdbc/ terajdbc4.jar")
conn = dbConnect(drv,"jdbc:teradata://111.111.111.111/ TMODE=TERA",user="hlim",password="1234",dbname="hlim")
dbWriteTable(conn = tdConnection, name = "DWSP_ETL_STG.testme", value = my.stats, row.names = F, overwrite = T, append = T)
Many thanks for your help!!!!
Hock