0

I am trying to overwrite an existing fgdb table with a R-script and the arcgisbinding package. I want to then place this script in Model Builder and use the resulting table in the rest of the model.

enter image description here

enter image description here

Here is a simplified version of the R-Script.

tool_exec <- function(in_params, out_params) {
  inTable <- in_params[[1]]
  dfOpen <- arc.open(inTable)
  df <- arc.select(dfOpen)
  df$A <- 0
  df$B <- "xxx"
  # Create the output table
  arc.write(inTable, df)

}

It gives the error:

Error in .call_proxy : The table already exists.

I have tried giving the output table a different name, but then if I run the script again I end up with the same problem. If I change the Type of the OutputTable parameter from Derived to Required then I can specify a new table name each time (which I dont want to do) but then once I run the tool once, I have to specify the OutputTable location again manually.

Is there a way around this error?

Notes The box is ticked for the Geoprocessing Options - Overwrite the outputs of geoprocessing operations. I have very limited Python knowledge so that is why I am trying to do it in R & Model Builder.

  • did you ever figure this out? i have the same problem – JamesPatrick Jun 15 '18 at 11:39
1

try adding these lines:

tool_exec <- function(in_params, out_params) {


inTable <- in_params[[1]]
**Output <- out_params[[1]]**
dfOpen <- arc.open(inTable)
df <- arc.select(dfOpen)
df$A <- 0
df$B <- "xxx"
# Create the output table
arc.write(inTable, df)
**return(out_params)**

It worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.