Doing INSERTs into Teradata from R
Options
![Antal](https://us.v-cdn.net/6038231/uploads/lithium_attachments/n6551iE4D96619C628B5D0.jpg)
Antal
Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 85 Neuron
I want to do INSERTs into Teradata Vantage database from an R script using the dataiku R api. Speciaficaly to support database interaction from a shiny app.
I've tried doing the following:
library(dataiku) dataiku::dkuSQLQueryToData(connection="DATAIKU_DEV_03", query="insert into <database>.<table> values (1, 2, 3, 4)")
which doesn't give an error, but also nothing happens...
I've read in the documentation (here https://doc.dataiku.com/dss/api/8.0/R/dataiku/reference/dkuSQLQueryToData.html), that in some databases a COMMIT is needed after the transaction.
However, doing:
dataiku::dkuSQLQueryToData(connection="DATAIKU_DEV_03", query="insert into <database>.<table> values (1, 2, 3, 4)", postQueries=c("COMMIT"))
Gives the error:
[Teradata Database] [TeraJDBC 17.10.00.22] [Error 3706] [SQLState 42000] Syntax error: COMMIT WORK not allowed for a DBC/SQL session.
Does anyone know how to do this in Teradata database?