delete | R Documentation |
db.obj
object or a table/view in the database 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.
## 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 'bagging.model'
delete(x)
x |
The signature of the method. A Or a Or a string, the table/view name to delete in the database. In the
this case, the result model tables wrapped by |
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
.
## 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.