3.2.3.5.7 Delete a Datastore
With the ore.delete
function, you can delete objects from an OML4R datastore or you can delete the datastore itself.
To delete a datastore, you specify the name of it. To delete one or more objects from the datastore, you specify the list
argument. The ore.delete
function returns the name of the deleted objects or datastore.
When you delete a datastore, OML4R discards all temporary database objects that were referenced by R objects in the deleted datastore. If you have saved an R object in more than one datastore, then OML4R discards a temporary database object only when no object in a datastore references the temporary database object.
Example 3-23 Using the ore.delete Function
This example demonstrates using ore.delete
to delete an object from a datastore and then to delete the entire datastore. The example uses objects created in Example 3-18.
# Delete the df2 object from the ds1 datastore. ore.delete("ds1", list = "df2") # Delete the datastore named ds1. ore.delete("ds1")Listing for Example 3-23
R> # Delete the df2 object from the ds1 datastore.
R> ore.delete("ds1", list = "df2")[1] "df2"
R> # Delete the datastore named ds1.
R> ore.delete("ds1")
[1] "ds1"
Parent topic: Save and Manage R Objects in the Database