# NOT RUN {
<!-- %% @test .port Database port number -->
<!-- %% @test .dbname Database name -->
## 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)
# }
Run the code above in your browser using DataLab