Name

DROP-INDEX — Drop a database index.Function

Syntax

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

Arguments and Values

name

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

on

The name of a 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 index called name in database which defaults to *default-database*. If the index does not exist and if-does-not-exist is :ignore then drop-index returns NIL whereas an error is signalled if if-does-not-exist is :error.

The argument on allows the optional specification of a table to drop the index from. This is required for compatability with MySQL.

Examples

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

Side Effects

An index is dropped in 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-index
list-indexes
index-exists-p

Notes

The if-does-not-exist and on keyword arguments to drop-index are CLSQL extensions. The keyword argument on is provided for compatibility with MySQL.