File: sqlDrop.Rd

package info (click to toggle)
rodbc 1.3-26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,892 kB
  • sloc: ansic: 1,225; makefile: 4; sh: 1
file content (62 lines) | stat: -rw-r--r-- 1,947 bytes parent folder | download | duplicates (6)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% file RODBC/man/sqlDrop.Rd
% copyright (C) 1999-2002  M. Lapsley
% copyright (C) 2002-2013  B. D. Ripley
%
\name{sqlDrop}
\alias{sqlDrop}
\alias{sqlClear}

\title{Deletion Operations on Tables in ODBC databases}
\description{
  \code{sqlClear} deletes all the rows of the table \code{sqtable}.

  \code{sqlDrop} removes the table \code{sqtable} (if permitted).
}
\usage{
sqlClear(channel, sqtable, errors = TRUE)

sqlDrop(channel, sqtable, errors = TRUE)
}
\arguments{
  \item{channel}{connection object as returned by \code{\link{odbcConnect}}.}
  \item{sqtable}{character string: a database table name accessible from the
    connected DSN.  This can be a \sQuote{dotted} name of the form
    \code{\var{schema}.\var{table}}.}
  \item{errors}{logical: if \code{TRUE} halt and display error, else
    return \code{-1}.}
}
\details{
  These submit \samp{TRUNCATE TABLE} and \samp{DROP TABLE} SQL queries
  respectively.

  \sQuote{Dotted} table names are allowed on systems that support them
  but the existence of the table is not checked and so attempting these
  operations on a non-existent table will give a low-level error.  (This
  can be suppressed by opening the connection with \code{interpretDot =
    FALSE}.)

  The default \sQuote{drop} behaviour in Oracle is to move the table to
  the \sQuote{recycle bin}: use
\preformatted{
  sqlQuery(channel, "PURGE recyclebin")
}
  to empty the recycle bin.

  The current user might not have privileges to allow these operations,
  and Actual Technologies' Mac OS X SQLite driver has a bug causing them
  silently to fail.
}  

\value{
  If \code{errors = FALSE}, a numeric value, invisibly.
  Otherwise a character string or \code{invisible()}.
}
\seealso{
  \code{\link{odbcConnect}}, \code{\link{sqlQuery}}, \code{\link{sqlFetch}},
  \code{\link{sqlSave}}, \code{\link{sqlTables}}, \code{\link{odbcGetInfo}}
}
\author{
  Michael Lapsley and Brian Ripley
}
\keyword{IO}
\keyword{database}