R/gta_sql_save.R

Defines functions gta_sql_save

gta_sql_save <- function(path) {

  # Construct the update query by looping over the data fields
  query <- sprintf(
    "INSERT INTO %s (%s) VALUES ('%s')",
    table, 
    paste(names(data), collapse = ", "),
    paste(data, collapse = "', '")
  )
  
  
  sql <- "SELECT * FROM City WHERE ID = ?id1 OR ID = ?id2 OR ID = ?id3;"
  query <- sqlInterpolate(conn, sql, id1 = input$ID1,
                          id2 = input$ID2, id3 = input$ID3)
  # Submit the update query and disconnect
  dbGetQuery(ricardo.connection, query)
  
}
global-trade-alert/gtasql documentation built on April 25, 2022, 10:33 a.m.