$Revision: 1.1.2.4 $
Package: DBI
Arguments: ((&key types column-names
do-column-names return hstmt width) &rest body)
After executing a sql statement with rr-sql, this form loops once for each result row, evaluating the body. types specifies how the values for each column should be returned (as it does for sql, see below for possible values of types). If you wish to have a list of the result column names computed, then pass a symbol as the value of column-names and pass a true value for do-column-names. If this is done then the symbol that is the value of column-names will be bound to the list of column names before the first time that body is evaluated. After body is evaluated for the last time the expression return is evaluated and the value of it is the value of the loop-over-results form. The statement handle of the results that are being scanned by this form is hstmt.
Within the body there are two macros defined: column-count and column-value. The macro column-count takes no arguments and its value is the number of columns of results available. The column-value macro takes one argument, the column number, and returns the value in that column for the current row. Note: column numbers are one-based, thus the value passed to column-value should be between 1 and the number of columns returned. The type of value returned by column-value will be a string unless some other type of value is specified in the types argument.
width is the size for character buffers used in retrieving character-valued fields. If not given, then the width for the database, db-width, is used.
types should be either the keyword :auto or a list of type
specifiers from the following table. The value :auto means that the types
will be determined automatically from the query results.
| Specifier | Meaning |
| :int | return as a 4 byte signed value |
| :long | return as a 4 byte signed value |
| :double | return as an 8 byte floating point value |
| t | return as a string or nil for the null value (the default) |
Note: an earlier version of this document stated that :auto
was permissible as a value in the list of type specifiers when types is a list.
That was incorrect. types can be :auto or a list consisting of the
specifiers in the table above, which does not contain :auto.
This symbol is associated with the Allegro CL ODBC (AODBC) interface, version 2. Version 2 is new in Allegro CL 5.0.1. It is incompatible with the earlier version 1. Not all customers will have Allegro ODBC version 2. Contact your Franz Inc. sales representative for more information.
Allegro ODBC version 2 is described in aodbc_v2.htm.
The general documentation description is in introduction.htm. The index in index.htm.
Copyright (C) 1998-1999, Franz Inc., Berkeley, CA. All Rights Reserved.