Literal SQL statements can simply be enclosed in the square bracket syntax, as shown below.
Creating a full query (which can be used as argument to query):
["SELECT FOO, BAR FROM BAZ"]
-> #<SQL "SELECT FOO, BAR FROM BAZ">
Using an unportable function condition in
:where
:
(sql:select [*] :from ["aTable"]
:where ["unportable_function() > 89"])
LispWorks User Guide and Reference Manual - 21 Dec 2011