All Manuals > LispWorks® User Guide and Reference Manual > 45 The SQL Package

print-query Function

Summary

Prints a tabulated version of records resulting from a query.

Package

sql

Signature

print-query query-exp &key titles formats sizes stream database

Arguments
query-exp
A SQL query expression.
titles
A list of strings.
formats
A list of strings.
sizes
A list.
stream
An output stream.
database
A database.
Description

The function print-query takes a symbolic SQL query expression query-exp and formatting information and prints onto stream a table containing the results of the query in database.

database defaults to the value of *default-database*.

A list of strings to use as column headings is given by titles, which has a default value of nil.

formats is a list of format strings used to print each attribute, and has a default value of t, which means that ~A or ~VA are used if sizes are provided or computed.

The field sizes are given by sizes. It has a default value of t, which specifies that minimum sizes are computed.

The output stream is given by stream, which has a default value of t. This specifies that *standard-output* is used.

Examples

The following call prints out two even columns of names and salaries:

(print-query [select [surname] [income] :from [person]] 
             :titles '("NAME" "SALARY"))
See also

map-query
print-query
select


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:56