Performs a body of code within a transaction for a database.
A set of Lisp expressions.
The values returned by
within a transaction for
(which defaults to *default-database*). The transaction is committed if the body finishes successfully (without aborting or throwing), otherwise the database is rolled back.
returns the value or multiple values returned from
The following example shows how to use
to insert a new record, updates the department number of employes from 40 to 50, and removes employees whose salary is higher than 300,000. If an error occurs anywhere in the body and an
is executed, none of the updates are committed.
(insert-record :into [emp]
:attributes '(x y z)
:values '(a b c))
:where [= [dept] 40])
(delete-records :from [emp]
:where [> [salary] 300000]))
LispWorks Reference Manual - 12 Mar 2008