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

NextPrevUpTopContentsIndex

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 the args are concatenated with a single space between each pair. The rules for translation into SQL, based on the type of each individual argument x, are as follows:

string => (format nil "'~A'" x) nil => "NULL" symbol => (symbol-name x) number => (princ-to-string x) list => (format nil "(~{~A~^,~})" (mapcar #'sql x)) vector => (format nil "~{~A~^,~}" (map 'list #'sql x)) sql-expression => x

Any other symbol => error

See also

sql-expression
sql-operation
sql-operator


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex