;;;; 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) "")