MINI MINI MANI MO
%
% Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
%
% NAME
% ore.create.Rd - Create and Drop Data from the User's Oracle Schema
%
% DESCRIPTION
% Create an Oracle Database table from a data.frame or ore.frame
% object, or a view from an ore.frame object. Drop a database table
% or view.
%
% NOTES
%
% MODIFIED (MM/DD/YY)
% demukhin 11/02/12 - bug 14729804: document row names
%
\name{ore.create}
\alias{ore.create}
\alias{ore.create,data.frame-method}
\alias{ore.create,ore.frame-method}
\alias{ore.drop}
\title{Database Table Creation or Destruction Functions}
\description{
Create an Oracle Database table from a \code{data.frame} or
\code{ore.frame} object, or a view from an \code{ore.frame} object.
Drop a database table or view.
}
\usage{
ore.create(x, table = NULL, view = NULL)
ore.drop(table = NULL, view = NULL)
}
\arguments{
\item{x}{
A \code{\linkS4class{ore.frame}} object. Can also be a
\code{\link[base]{data.frame}} if argument \code{table} is used.
}
\item{table}{
A character string specifying the name of the table. This argument
cannot be used with argument \code{view}.
}
\item{view}{
A character string specifying the name of the view. This argument
cannot be used with argument \code{table}.
}
}
\details{
Exactly one of arguments \code{table} or \code{view} must be
specified, depending on whether a database table or view is desired
for creation or dropping.
When a new object is created using function \code{ore.create}, it is
automatically included into the list of objects that can be accessed
via \code{ore.get} and \code{ore.ls} functions. It will also be added
to the list of attached \code{ore.frame} objects if \code{ore.attach}
was already called. Also for function \code{ore.create}, only an
\code{\linkS4class{ore.frame}} object can be used with the \code{view}
argument.
Similarly, when an object is removed using function \code{ore.drop},
it will no longer show up in output of \code{ore.ls} function. It will
also be removed from a list of attached \code{ore.frame} objects.
If the input object contains column names that do not match the naming
convention of the backend server they will be modified by
\code{ore.make.names} function.
Function \code{ore.create} does not preserve \code{row.names} neither
in the database table nor in the newly created \code{ore.frame} object.
}
\value{
Both functions \code{ore.create} and \code{ore.drop} return an
invisible \code{NULL} value.
}
\references{
\href{http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/documentation/index.html}{Oracle R Enterprise}
}
\author{
Oracle \email{oracle-r-enterprise@oracle.com}
}
\seealso{
\code{\link{ore.ls}},
\code{\link{ore.exists}},
\code{\link{ore.sync}},
\code{\link{ore.rm}},
\code{\link{ore.attach}},
\code{\link{ore.connect}}
}
\examples{
if (!interactive())
{
ore.drop(table = "TEN_LETTERS")
ore.drop(table = "IRIS_TABLE")
ore.drop(view = "IRIS_VIEW")
ore.create(data.frame(x = 1:10, y = letters[1:10]),
table = "TEN_LETTERS")
ore.exists("TEN_LETTERS")
ore.create(iris, table = "IRIS_TABLE")
ore.create(head(ore.get("IRIS_TABLE"), 10), view = "IRIS_VIEW")
ore.exists("IRIS_VIEW")
ore.drop(table = "TEN_LETTERS")
ore.drop(table = "IRIS_TABLE")
ore.drop(view = "IRIS_VIEW")
}
}
\keyword{environment}
\keyword{database}
\keyword{ORE}
OHA YOOOO