+ Repeatedly executes <parameter>body</parameter> within a
+ binding of <parameter>args</parameter> on the fields of each
+ row selected by the SQL query
+ <parameter>query-expression</parameter>, which may be a string
+ or a symbolic SQL expression, in
+ <parameter>database</parameter> which defaults to
+ <symbol>*default-database*</symbol>.
+ </para>
+ <para>
+ The body of code is executed in a block named
+ <symbol>nil</symbol> which may be returned from prematurely
+ via <function>return</function> or
+ <function>return-from</function>. In this case the result of
+ evaluating the <function>do-query</function> form will be the
+ one supplied to <function>return</function> or
+ <function>return-from</function>. Otherwise the result will
+ be <symbol>nil</symbol>.
+ </para>
+ <para>
+ The body of code appears also is if wrapped in a
+ <function>destructuring-bind</function> form, thus allowing
+ declarations at the start of the body, especially those
+ pertaining to the bindings of the variables named in
+ <parameter>args</parameter>.
+ </para>
+ <para>
+ <parameter>result-types</parameter> is a list of symbols which
+ specifies the lisp type for each field returned by
+ <parameter>query-expression</parameter>. If
+ <parameter>result-types</parameter> is &nil; all results are
+ returned as strings whereas the default value of
+ <symbol>:auto</symbol> means that the lisp types are
+ automatically computed for each field.
+ </para>
+ <para>
+ <parameter>query-expression</parameter> may be an object query
+ (i.e., the selection arguments refer to View Classes), in
+ which case <parameter>args</parameter> are bound to the tuples
+ of View Class instances returned by the object oriented query.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <screen>
+(do-query ((salary name) "select salary,name from simple")
+ (format t "~30A gets $~2,5$~%" name (read-from-string salary)))
+>> Mai, Pierre gets $10000.00
+>> Hacker, Random J. gets $08000.50
+=> NIL
+
+(do-query ((salary name) "select salary,name from simple")
+ (return (cons salary name)))
+=> ("10000.00" . "Mai, Pierre")
+
+(let ((result '()))
+ (do-query ((name) [select [last-name] :from [employee]
+ :order-by [last-name]])
+ (push name result))
+ result)
+=> ("Yeltsin" "Trotsky" "Stalin" "Putin" "Lenin" "Kruschev" "Gorbachev"
+ "Chernenko" "Brezhnev" "Andropov")
+
+(let ((result '()))
+ (do-query ((e) [select 'employee :order-by [last-name]])
+ (push (slot-value e 'last-name) result))
+ result)
+=> ("Yeltsin" "Trotsky" "Stalin" "Putin" "Lenin" "Kruschev" "Gorbachev"
+ "Chernenko" "Brezhnev" "Andropov")
+ </screen>
+ </refsect1>
+ <refsect1>
+ <title>Side Effects</title>
+ <para>Whatever effects the execution of the SQL query has
+ on the underlying database, if any.</para>
+ </refsect1>
+ <refsect1>
+ <title>Affected by</title>
+ <para>None.</para>
+ </refsect1>
+ <refsect1>
+ <title>Exceptional Situations</title>
+ <para>If the execution of the SQL query leads to any
+ errors, an error of type
+ <errortype>sql-database-error</errortype> is signalled.</para>
+ <para>If the number of variable names in
+ <parameter>args</parameter> and the number of attributes in
+ the tuples in the result set don't match up, an error is
+ signalled.</para>
+ </refsect1>
+ <refsect1>
+ <title>See Also</title>
+ <simplelist>
+ <member><link linkend="query"><function>query</function></link></member>
+ <member><link linkend="map-query"><function>map-query</function></link></member>
+ <member><link linkend="print-query"><function>print-query</function></link></member>
+ <member><link linkend="loop-tuples"><function>loop</function></link></member>
+ <member><link linkend="select"><function>select</function></link></member>
+ </simplelist>
+ </refsect1>
+ <refsect1>
+ <title>Notes</title>
+ <para>The <parameter>result-types</parameter> keyword argument
+ is a &clsql; extension.</para>
+ <para>
+ <parameter>do-query</parameter> is common across the functional
+ and object-oriented data manipulation languages.