I am not able to write data to a table part of the different owner (Oracle data base) using dbwriteTable()
even after I have INSERT
Grants.
I have tried using the below option but, getting an error. When I tried checking the dbExistsTable()
, it is returning true for the same table. Execution Steps followed:
Connecting to DB:
library(RJDBC)
drv <- JDBC("oracle.jdbc.OracleDriver",
classPath = "C:/oracle_64/product/11.2.0/client_2/jdbc/lib/ojdbc6.jar", " ")
con <- dbConnect(drv, "jdbc:oracle:thin:@//hostname:1521/oracle_sid",
"MASTER_OWNER", "PASSWORD" )
Write Dataframe into Oracle Table:
dbWriteTable(conn, "R_STG_INSERT", DF_NAME, row.names = FALSE,
overwrite = FALSE, append = TRUE, schema = "TEST_OWNER")
Note: The same dbWriteTable()
is working, if it is with same Database Owner. I am able to use it as expected.
Expected: Load the data frame into Oracle table
Actual: Error Message
Error in .local(conn, statement, ...) : execute JDBC update query failed in dbSendUpdate (ORA-00942: table or view does not exist ) Calls: dbWriteTable ... dbWriteTable -> .local -> dbSendUpdate -> dbSendUpdate -> .local Execution halted