updatetable {sqlcaser}R Documentation

Generate a SQL UPDATE statement from a mapping file

Description

This function constructs an UPDATE statement from a mapping file or dataframe. It assumes that the first column of the data contains the key column and list of keys for the rows where the corresponding other columns have to be updated. It also assumes that the header for the data includes the column names. The function will generate one UPDATE statement for each row in the data.

Usage

updatetable(inputfile = NULL, tablename = NULL)

Arguments

inputfile

Dataframe OR path to the mapping file

tablename

Name of the SQL table

Value

A string that represents the constructed UPDATE statement(s)

Examples

 input <- Data_Frame <- data.frame(Training = c("Strength", "Stamina",
  "Other"), Pulse = c(100, 150, 120), Duration = c(60, 30, 45))
 result <- updatetable(inputfile = input, tablename = "myTable")

[Package sqlcaser version 0.2.0 Index]