Delete all or some rows in a table in a MySQL database (referenced by 'edb').

Share:

Description

Delete all or some rows in a table in a MySQL database (referenced by 'edb').

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S3 method for class 'RODBC_MySQL'
edbDelete(edb, tableName, sRow = NULL, 


    sRowOp = c("AND", "OR")[1], logOp = FALSE, logRandId = rnorm(1), 


    logMsg = as.character(NA), logTableName = "edbLog", 


    logCreateTableIfNotExist = TRUE, testFiles = TRUE, 


    verbose = FALSE, ...)

Arguments

edb

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

tableName

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

sRow

A list of named items. List of contrains/criterion to be applied

on tableName to retrieve a subset of rows. Each item in

rowC must be named after the columns on which the constrain

apply. The (vector of) value(s) of each items are the possible values

that can be retrieved. Values can be character or numeric. If NULL

(the default), all values are returned.

sRowOp

A single character string. Operator to be used to combine multiple

constrains in sRow. Possible values are "OR" or "AND". Default value

is "AND".

logOp

Single logical. If TRUE, then a log of the operation is written

into the database, using the function edbLog.

See the arguments below and edbLog for more details.

logRandId

Single numerical. See edbLog.

logMsg

Single character string. See edbLog.

logTableName

Single character string. See edbLog.

logCreateTableIfNotExist

Single logical. See edbLog.

testFiles

Single logical. Should the function test for the presence

(file.exist()) of the needed files in the folder before trying

to fetch information from the database?

verbose

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

on screen.

...

Additional parameters to be passed to dbGetQuery.

Value

The function returns the requested table.

Author(s)

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

See Also

edb, edbWrite.RODBC_MySQL,

edbNames.RODBC_MySQL,

edbColnames.RODBC_MySQL.

Examples

1
# See ?edbWrite.RODBC_MySQL for an example