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

sql Function

Summary

Generates SQL from a set of expressions.

Package

sql

Signature

sql &rest args => sql-expression

Arguments
args
A set of expressions.
Values
sql-expression
A SQL expression.
Description

The function sql generates SQL from a set of expressions given by args. Each argument to sql is translated into SQL and then concatenated with a single space between each pair. The rules for translation into SQL, based on the type of each individual argument arg, are as follows:

string
(format nil "'~A'" arg)
nil
"NULL"
symbol
(symbol-name arg)
number
(princ-to-string arg)
list
(format nil "(~{~A~^,~})" (mapcar #'sql arg))
vector
(format nil "~{~A~^,~}" (map 'list #'sql arg))
sql-expression
The expression represented by arg.
Any other type.
The printed representation of arg.
See also

sql-expression
sql-operation
sql-operator


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