Next Prev Up Top Contents Index

do-query

Macro
Summary

Repeatedly binds a variable to the results of a query, and executes a body of code using the bound variable.

Package

sql

Signature

do-query ((&rest args ) query &key database ) &body body =>

Arguments

args

A set of bindings.

query

A database query.

database

A database.

body

A Lisp code body.

Values

None.

Description

The macro do-query repeatedly executes body within a binding of args on the attributes of each record resulting from query . The return value of do-query is determined by the result of executing body .

The default value of database is *default-database* .

Example

The following code repeatedly binds the result of selecting an entry in ename from the table emp to the variable name , and then prints name using the Lisp function print .

(do-query ((name) [select [ename] :from [emp]])
         (print name))
See also

loop
map-query
query
select


LispWorks Reference Manual - 25 Jul 2003

Next Prev Up Top Contents Index