Name

DELETE-RECORDS — Delete records from a database table.Function

Syntax

      delete-records &key from where database => 

Arguments and Values

from

A string, symbol or symbolic SQL expression representing the name of a table existing in database.

where

A symbolic SQL expression.

database

A database object. This will default to the value of *default-database*.

Description

Deletes records satisfying the SQL expression where from the table specified by from in database specifies a database which defaults to *default-database*.

Examples

(select [first-name] [last-name] [email] 
        :from [employee]
        :where [= [emplid] 11] 
        :field-names nil)
=> (("Yuri" "Gagarin" "gagarin@soviet.org"))
(delete-records :from [employee] :where [= [emplid] 11])
=> 
(select [first-name] [last-name] [email] 
        :from [employee]
        :where [= [emplid] 11] 
        :field-names nil)
=> NIL
      

Side Effects

Modifications are made to the underlying database.

Affected by

None.

Exceptional Situations

An error of type sql-database-data-error is signalled if from is not an existing table in database or if the SQL statement resulting from the symbolic expression where does not return a Boolean value.

See Also

insert-records
update-records

Notes

None.