In some cases it is necessary to build SQL-expressions dynamically under program control.
. For examples see sql-operation.
The function sql-expression makes a SQL expression from the given keywords. This is equivalent to the first and third uses of the
syntax as discussed in The "[...]" Syntax.
The function sql makes SQL out of the arguments supplied. Each argument to sql is turned into SQL and then the
are concatenated with a single space between each pair. A Lisp string maps to the same characters enclosed between single quotes (this corresponds to a SQL string constant).
, that is, a SQL null value. Symbols and numbers map to strings. A list maps to a parenthesised, comma-separated expression. A vector maps to a comma-separated expression, which allows the easy generation of SQL lists that require no parentheses such as table lists in select statements.
The rules for the conversion are fully specified in sql.
LispWorks User Guide and Reference Manual - 21 Dec 2011