Jack Tanner wrote:
> I'd like to loop over the results of an AODBC query object using
> dbi:fetch-row. Could someone give an example of the correct syntax for
> testing for "eof-value"?
Thanks to the kind person who responded to me off-list, the correct
syntax is:
(let ((row (dbi:fetch-row <your query here> nil :the-end)))
(if (eq row :the-end)
(<no more rows; do sth accordingly>)
(<do whatever you want with the row here>)))
Specifically, here's a tail-recursive function that works nicely:
(defun print-all-rows (query-obj)
(let ((row (dbi:fetch-row query-obj nil :eof)))
(cond ((eq row :eof)
(dbi:close-query query-obj))
(t
(print row)
(print-all-rows query-obj))
)))
Regards,
JT