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

NextPrevUpTopContentsIndex

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.

Values

None.

Description

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

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

The formats argument 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 - 13 Feb 2015

NextPrevUpTopContentsIndex