z[_-.RODBC_MySQL: "[<-" method for MySQL databases. Write data in a MySQL table...

Description Usage Arguments Author(s) See Also

Description

"[<-" method for MySQL databases. Write data in a table in a

MySQL database (referenced by 'edb').

Usage

1
2
## S3 replacement method for class 'RODBC_MySQL'
edb[tableName, mode = "a", pKey = NULL, getKey = NULL, formatCol = NULL, posixFormat = "", dateFormat = "", parano = TRUE, verbose = FALSE, ...] <- value

Arguments

edb

An object of class 'edb', such as returned by edb.

tableName

Single character string. Name of the table to read in 'edb'.

mode

Single character string. If "a" (default), the data are

appened to the table (added after the last row), and sRow

is ignored. If "u", the data are updated according to some

critearia in sRow (that can't be NULL). If "o",

the table is overwritten and sRow is ignored.

pKey

Single character string (if mode == "u") or NULL. Column name that

is PRIMARY KEY in the table.

getKey

Single character string or NULL. If non NULL, name of the PRIMARY

KEY whose latest attributed values should be retrieved.

formatCol

If not NULL, a named list of functions to be applied to certain columns

before the data are written to the database. The name of each list

item gives the column to process, and the value of each item gives the

function that must be applied. For instance

formatCol = list("DATE"=as.Date) will apply the function

as.Date to the column "DATE".

posixFormat

Single character string. 'format' argument of the functions

format.POSIXlt() or format.POSIXct() used to convert POSIX

date-time into character strings when writing into the database.

Only used if getKey is not NULL or when mode == "u" in SQLite or

MySQL.

dateFormat

Single character string. 'format' argument of the functions

format.Date() used to convert "Date"

dates into character strings when writing into the database.

Only used if getKey is not NULL or when mode == "u" in SQLite or

MySQL.

parano

Single logical. If set to TRUE (the default), the function is

run on "paranoia mode", that is additional tests are performed

before the data are written into the database. This slows down

a bit (more) the function, but it may avoid some mistakes.

verbose

Single logical. If TRUE, information on what is done are output

on screen.

...

Additional parameters to be passed to class-specific method. See

methods("edbWrite")

value

data.frame. Data to be writen in tableName. If the table

has a PRIMARY KEY, and if it is AUTOINCREMENT, then the column

can be omitted, and the attributed ID's will be retrieved if

!is.null(getKey) (not the default). If sRow is not

NULL, then data must contain the column names given in sRow.

Author(s)

Julien MOEYS <Julien.Moeys@mark.slu.se>

See Also

edb, edbWrite.RODBC_MySQL,

edbRead.RODBC_MySQL.


easyrodbcmysql documentation built on May 2, 2019, 5:51 p.m.