Name

DROP-TABLE — Drop a database table.Function

Syntax

      drop-table name &key if-does-not-exist database => 

Arguments and Values

name

The name of the table as a string, symbol or SQL expression.

database

A database object which defaults to *default-database*.

if-does-not-exist

A symbol. Meaningful values are :ignore or :error (the default).

Description

Drops the table called name from database which defaults to *default-database*. If the table does not exist and if-does-not-exist is :ignore then drop-table returns NIL whereas an error is signalled if if-does-not-exist is :error.

Examples

(table-exists-p [foo])
=> T
(drop-table [foo] :if-does-not-exist :ignore)
=> 
(table-exists-p [foo])
=> NIL        
      

Side Effects

A table is dropped database.

Affected by

*default-database*

Exceptional Situations

An error is signalled if name is not a string, symbol or SQL expression. An error of type sql-database-data-error is signalled if name doesn't exist and if-does-not-exist has a value of :error.

See Also

create-table
list-tables
table-exists-p

Notes

The if-does-not-exist keyword argument to drop-table is a CLSQL extension.