Next Previous Up Top Contents Index

16 The SQL Package

map-query

Function

Summary

Returns the results of mapping a function across an SQL query statement.
Package

sql

Signature

map-query output-type-spec function query-exp &key database => result

Arguments

output-type-spec

The output type specification.

result-type

The result sequence type.

function

A function.

query-exp

An SQL query.

database

A database.

Values

result

A sequence of type output-type-spec containing the results of the map function.

Description

The functionmap-query returns the result of mapping function across the results of query-expression. The output-type-spec argument specifies the type of the result sequence as per the Common Lispmap function.
The default value of database is*default-database*.
Example

This example bindsname to each name in the employee table and prints it.
(map-query
   ´null
   #'(lambda (name) (print name))
   [select [ename] :from [emp] :flatp t])

See also

do-query
loop
print-query
query
select

LispWorks Reference Manual - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker