r4829: Auto commit for Debian build
[umlisp.git] / sql-classes.lisp
index 6e62db214a273c52f4837b2f74e240b971f78aec..a66a455495ccc4ef02bd745af308dc11b39ebc3b 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: sql-classes.lisp,v 1.71 2003/05/06 01:34:57 kevin Exp $
+;;;; $Id: sql-classes.lisp,v 1.72 2003/05/06 02:41:01 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
    'string
    (format nil "select ~A~{~:@(~A~)~^,~} from ~:@(~A~)" 
           (if distinct "distinct " "") fields table)
+   (if where-name (format nil " where ~:@(~A~)" where-name) "")
    (if where-name
        (format nil
               (typecase where-value
-                (number " where ~A=~D")
-                (null " where ~A is null")
+                (number "=~D")
+                (null " is null")
                 (t
-                 (if like
-                     " where ~A like '%~A%'"
-                     " where ~A='~A'")))
-              where-name where-value)
+                 (if like " like '%~A%""='~A'")))
+              where-value)
        "")
    (if srl (format nil " and ~:@(~A~)<=~D" lrl srl) "")
    (if order (format nil " order by ~{~:@(~A~) ~(~A~)~^,~}" order) "")