map-query output-type-spec function query-exp &key database not-inside-transaction get-all => result
The output type specification.
The result sequence type.
A function.
A SQL query or a prepared-statement containing a query.
A database.
A generalized boolean.
The function map-query
returns the result of mapping function across the results of query-exp. The output-type-spec argument specifies the type of the result sequence as per the Common Lisp map
function.
The default value of database is *default-database*.
not-inside-transaction and get-all may be useful when fetching many records through a connection with database-type :mysql
. Both of these arguments have default value nil
. See the section Special considerations for iteration functions and macros for details.
This example binds name
to each name in the employee table and prints it.
(map-query
nil
#'(lambda (name) (print name))
[select [ename] :from [emp] :flatp t])
LispWorks User Guide and Reference Manual - 13 Feb 2015