Next Previous Up Top Contents Index

16 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

An 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

Theprint-query function 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 ofnil.
The formats argument is a list of format strings used to print each attribute, and has a default value oft, 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 oft, which specifies that minimum sizes are computed.
The output stream is given by stream, which has a default value oft. 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 Reference Manual - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker