Prints a tabulated version of records resulting from a query.
sql
print-query query-exp &key titles formats sizes stream database
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. |
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.
The following call prints out two even columns of names and salaries:
(print-query [select [surname] [income] :from [person]] :titles '("NAME" "SALARY"))
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:56