sqlDrop

0th

Percentile

Deletion Operations on Tables in ODBC databases

sqlClear deletes all the rows of the table sqtable.

sqlDrop removes the table sqtable (if permitted).

Keywords
IO, database
Usage
sqlClear(channel, sqtable, errors = TRUE)

sqlDrop(channel, sqtable, errors = TRUE)

Arguments
channel

connection object as returned by odbcConnect.

sqtable

character string: a database table name accessible from the connected DSN. This can be a ‘dotted’ name of the form schema.table.

errors

logical: if TRUE halt and display error, else return -1.

Details

These submit TRUNCATE TABLE and DROP TABLE SQL queries respectively.

‘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 interpretDot = FALSE.)

The default ‘drop’ behaviour in Oracle is to move the table to the ‘recycle bin’: use

  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 errors = FALSE, a numeric value, invisibly. Otherwise a character string or invisible().

See Also

odbcConnect, sqlQuery, sqlFetch, sqlSave, sqlTables, odbcGetInfo

Aliases
  • sqlDrop
  • sqlClear
Documentation reproduced from package RODBC, version 1.3-15, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.