Name
DELETE-INSTANCE-RECORDS — Delete SQL records represented by a view class
object.
Function
Syntax
(delete-instance-records object) =>
Arguments and Values
- object
An instance of a view class.
Description
Deletes the records represented by
object in the appropriate table of the
database associated with object. If
object is not yet associated with a
database, an error is signalled.
Examples
* (def-view-class tab () ((a :type integer :db-kind :key) (b :type string)))
#<clsql-sys::db-standard-class tab>
* (defvar obj (let ((*db-auto-sync* t))
(make-instance 'tab :a 5 :b "the string")))
* (start-sql-recording :type :both)
* (delete-instance-records obj)
Side Effects
Deletes data from the SQL database.
Affected by
Permissions granted by the SQL database to the user in the database connection.
Exceptional Situations
An exception may be signaled if the database connection user does not have
sufficient privileges to modify the database.
Notes
Instances are referenced in the database by values stored in the key slots. If
delete-records-from-instance is called with an instance of a class that does
not contain any keys, then all records in that table will be deleted.