X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Ffdml.lisp;h=b9a1153268e87ab2bb6f7691212eb450f9abf406;hp=fcd6a3dd637e3ada63170a81486825820f794f23;hb=79d8426bb78f25255a2cb2550ed2d41174b35b53;hpb=7a4858c944c2361dce485a69b66dcf1ad4dcad60 diff --git a/sql/fdml.lisp b/sql/fdml.lisp index fcd6a3d..b9a1153 100644 --- a/sql/fdml.lisp +++ b/sql/fdml.lisp @@ -209,7 +209,8 @@ types are automatically computed for each field." (qe (gensym "QUERY-EXPRESSION-")) (columns (gensym "COLUMNS-")) (row (gensym "ROW-")) - (db (gensym "DB-"))) + (db (gensym "DB-")) + (last-form-eval (gensym "LFE-"))) `(let ((,qe ,query-expression) (,db ,database)) (typecase ,qe @@ -226,11 +227,14 @@ types are automatically computed for each field." :result-types ,result-types) (when ,result-set (unwind-protect - (do ((,row (make-list ,columns))) + (do ((,row (make-list ,columns)) + (,last-form-eval nil)) ((not (database-store-next-row ,result-set ,db ,row)) - nil) + ,last-form-eval) (destructuring-bind ,args ,row - ,@body)) + (setq ,last-form-eval + (progn + ,@body)))) (database-dump-result-set ,result-set ,db))))))))) (defun map-query (output-type-spec function query-expression