;;;; Author: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: sql-classes.lisp,v 1.36 2003/05/03 20:20:31 kevin Exp $
+;;;; $Id: sql-classes.lisp,v 1.37 2003/05/03 20:24:22 kevin Exp $
;;;;
;;;; This file, part of UMLisp, is
;;;; Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
(defun current-srl! (srl)
(setq *current-srl* srl))
-
(defmacro with-umlisp-query ((table fields srl where-name where-value
&key (lrlname "KCUILRL") distinct single
order like)
(if ,where-name
(format nil
(if (stringp ,where-value)
- (if ,like
- " where ~A like '%~A%'"
- " where ~A='~A'")
+ (if ,like " where ~A like '%~A%'" " where ~A='~A'")
" where ~A=~A")
,where-name ,where-value)
"")
(when srl
(string-append ls (format nil " and KCUILRL <= ~d" srl)))
(string-append ls " limit 1")
- (awhen (car (mutex-sql-query ls))
- (destructuring-bind (kpfstr kcuilrl) it
- (make-instance 'ucon :cui cui :pfstr kpfstr
- :lrl (ensure-integer kcuilrl)))))))
+ (let ((tuple (car (mutex-sql-query ls))))
+ (destructuring-bind (kpfstr kcuilrl) tuple
+ (make-instance 'ucon :cui cui :pfstr kpfstr
+ :lrl (ensure-integer kcuilrl)))))))
(defun find-ucon-cui-sans-pfstr (cui &key (srl *current-srl*))
"Find ucon for a cui"