Description Usage Arguments Details Value Author(s) See Also Examples
This function deletes a db.data.frame object together with the
table/view that it points to. It deletes a db.Rquery object. It
can also directly delete a table or view in the database. When applied
onto some composite data objects, it deletes the data table wrapped by
them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ## S4 method for signature 'db.data.frame'
delete(x, cascade = FALSE)
## S4 method for signature 'db.Rquery'
delete(x)
## S4 method for signature 'character'
delete(x, conn.id = 1, is.temp = FALSE, cascade =
FALSE)
## S4 method for signature 'arima.css.madlib'
delete(x)
## S4 method for signature 'summary.madlib'
delete(x)
## S4 method for signature 'lm.madlib'
delete(x)
## S4 method for signature 'lm.madlib.grps'
delete(x)
## S4 method for signature 'logregr.madlib'
delete(x)
## S4 method for signature 'logregr.madlib.grps'
delete(x)
## S4 method for signature 'bagging.model'
delete(x)
## S4 method for signature 'elnet.madlib'
delete(x)
## S4 method for signature 'dt.madlib'
delete(x)
## S4 method for signature 'dt.madlib.grps'
delete(x)
|
x |
The signature of the method. A Or a Or a string, the table/view name to delete in the database; Or an object which is the result of Or an object which is the result of Or an object which is the result of Or an object which is the result of Or an object which is the result of Or an object which is the result of Or an object which is the result of |
conn.id |
An integer, default is 1. The connection ID to the database. |
is.temp |
A logical, default is |
cascade |
A logical, default is |
When a db.data.frame object is deleted, the table/view that is
associated with it is also deleted.
When x is db.data.frame or table/view name, this
function returns a logical value. which is TRUE if the deletion
is successful.
No value is returned if x is db.Rquery
Author: Predictive Analytics Team at Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
db.data.frame creates an object pointing to a table/view
in the database.
db.objects lists all tables and views in a database
together with their schema.
db.existsObject tests whether a table/view exists in the
database.
as.db.data.frame creates a db.data.frame from a
data.frame, a data file or a db.Rquery.
madlib.lm, madlib.glm,
madlib.summary, madlib.arima are MADlib
wrapper functions whose results can be safely deleted by this function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ## Not run:
## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)
delete("abalone", cid, is.temp = TRUE)
delete("abalone", cid, is.temp = FALSE)
delete("abalone", conn.id = cid)
x <- as.db.data.frame(abalone, "abalone", conn.id = cid)
lk(x, 10)
y <- as.db.data.frame(abalone, "abalone", conn.id = cid, is.temp = TRUE)
lk(y, 10)
db.existsObject("abalone", cid, is.temp = TRUE)
db.existsObject("abalone", cid, is.temp = FALSE)
delete("abalone", cid)
p <- db.objects()
p[p == "abalone"]
## Example: delete multiple tables
## all table in public schema start with "ornste"
to.delete <- db.objects("public.ornste", conn.id = cid)
for (table.name in to.delete) delete(table.name, conn.id = cid)
db.disconnect(cid, verbose = FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.