r11473: improve verbose status msgs
[umlisp.git] / sql-classes.lisp
index 5983f7c9cecfc80fccc308be45ac1acc64284a7c..8d8be13f98c0750ee05255367156a13d676d4065 100644 (file)
@@ -25,7 +25,7 @@
 (defun current-srl! (srl)
   (setq *current-srl* srl))
 
-(defmacro query-string (table fields &optional srl where-name where-value
+(defmacro query-string (table fields srl where-name where-value
                        &key (lrl "KCUILRL") single distinct order like limit
                         filter)
   (let* ((%%fields (format nil "SELECT ~A~{~:@(~A~)~^,~} FROM ~:@(~A~)"
@@ -73,7 +73,7 @@
          (t
           ""))))))
 
-(defun query-string-eval (table fields &optional srl where-name where-value
+(defun query-string-eval (table fields srl where-name where-value
                          &key (lrl "KCUILRL") single distinct order like limit filter)
   (when single (setq limit 1))
   (concatenate
@@ -228,7 +228,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   (ensure-cui-integer cui)
   (when cui
     (make-instance 'ucon :cui cui)))
-  
+
 (defun find-ucon-cui (cui &key (srl *current-srl*) without-pfstr)
   "Find ucon for a cui. If set SAB, the without-pfstr is on by default"
   (ensure-cui-integer cui)
@@ -252,11 +252,11 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   (unless cui (return-from find-uconso-cui nil))
 
   (collect-umlisp-query (mrconso (lat ts lui stt sui ispref aui saui scui sdui sab tty code str
-                                      srl suppress cvf kpfeng kcuisui kcuilui kcuilrl 
+                                      srl suppress cvf kpfeng kcuisui kcuilui kcuilrl
                                       kluilrl ksuilrl) srl cui cui)
-    (make-instance 'uconso :cui cui :lat lat :ts ts :lui lui :stt stt :sui sui :ispref ispref 
+    (make-instance 'uconso :cui cui :lat lat :ts ts :lui lui :stt stt :sui sui :ispref ispref
                    :aui aui :saui saui :scui scui :sdui sdui :sab sab :tty tty :code code
-                   :str str :srl srl :suppress suppress :cvf cvf :kpfeng kpfeng 
+                   :str str :srl srl :suppress suppress :cvf cvf :kpfeng kpfeng
                    :kcuisui kcuisui :kcuilui kcuilui :kcuilrl kcuilrl :kluilrl kluilrl
                    :ksuilrl ksuilrl)))
 
@@ -407,7 +407,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   (ensure-cui-integer cui)
   (collect-umlisp-query (mrrel (aui1 rel stype1 cui2 aui2 stype2 rela rui srui sab sl rg dir suppress cvf)
                               srl cui1 cui :lrl "KSRL" :filter filter)
-    (let ((rel                        
+    (let ((rel
       (make-instance 'urel :cui1 cui :aui1 (ensure-integer aui1) :stype1 stype1 :rel rel
                      :cui2 (ensure-integer cui2) :aui2 (ensure-integer aui2) :stype2 stype2
                      :rui (ensure-integer rui) :srui srui :rela rela :sab sab :sl sl :rg rg :dir dir
@@ -615,7 +615,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
                   :paui (ensure-integer paui)
                   :sab sab :rela rela :ptr ptr :hcd hcd :cvf cvf)))
 
-(defun find-usat-ui (cui &optional (lui nil) (sui nil) &key (srl *current-srl*))
+(defun find-usat-ui (cui &key lui sui (srl *current-srl*))
   (ensure-cui-integer cui)
   (ensure-lui-integer lui)
   (ensure-sui-integer sui)
@@ -734,7 +734,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
                        (if like "LIKE" "=")
                        (clsql-sys::sql-escape-quotes word)
                        (etypecase sab
-                         (string 
+                         (string
                           (format nil " c.sab='~A'" (clsql-sys::sql-escape-quotes sab)))
                          (cons
                           (format nil " c.sab IN (~{'~A'~^,~})"
@@ -752,7 +752,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
                        (clsql-sys::sql-escape-quotes word)
                        (typecase sab
                          (string
-                          (format nil " c.sab='" (clsql-sys::sql-escape-quotes sab)))
+                          (format nil " c.sab='~A'" (clsql-sys::sql-escape-quotes sab)))
                          (cons
                           (format nil " c.sab IN (~('~A'~^,~))"
                                   (mapcar 'clsql-sys::sql-escape-quotes sab)))
@@ -763,7 +763,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
           collect (destructuring-bind (sui cui lui str lrl stt suppress cuisui) tuple
                     (make-instance 'ustr :sui sui :cui cui :lui lui :str str :lrl lrl
                                    :stt stt :suppress suppress :cuisui cuisui)))))
-           
+
 
 (defun find-ucon-normalized-word (word &key (srl *current-srl*) (like nil))
   "Return list of ucons that match word, optionally use SQL's LIKE syntax"