X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=sql%2Fexpressions.lisp;h=cd2d768c6755391dbc36bfe0cae613b8378dffa8;hb=837ef5c074e599060d89b5fd51abbe6fcd960094;hp=5bce5d89c03e30d9b5118392b2d3f338aacd34e9;hpb=7c7fe600ddcae6e798bdc025f558183569f1ae7e;p=clsql.git diff --git a/sql/expressions.lisp b/sql/expressions.lisp index 5bce5d8..cd2d768 100644 --- a/sql/expressions.lisp +++ b/sql/expressions.lisp @@ -22,7 +22,7 @@ (defvar *sql-stream* nil "stream which accumulates SQL output") -(defun sql-output (sql-expr &optional database) +(defun sql-output (sql-expr &optional (database *default-database*)) "Top-level call for generating SQL strings. Returns an SQL string appropriate for DATABASE which corresponds to the supplied lisp expression SQL-EXPR." @@ -900,11 +900,10 @@ uninclusive, and the args from that keyword to the end." (defmethod database-output-sql ((tee (eql t)) database) (if database (let ((val (database-output-sql-as-type 'boolean t database (database-type database)))) - (if val - (typecase val - (string val) - (t (format nil "~A" val))) - "'Y'")) + (when val + (typecase val + (string (format nil "'~A'" val)) + (integer (format nil "~A" val))))) "'Y'")) #+nil(defmethod database-output-sql ((tee (eql t)) database)