From: Russ Tyndall Date: Thu, 20 Aug 2009 18:23:33 +0000 (-0400) Subject: special cased in ODBC limit handling X-Git-Url: http://git.kpe.io/?a=commitdiff_plain;h=da8501336f628590b5d080dcfa0487fc256da125;hp=95c3d1b5fb4b3479c4d36f5560c55ba6f77654b7;p=clsql.git special cased in ODBC limit handling --- diff --git a/sql/expressions.lisp b/sql/expressions.lisp index 971609e..16e967b 100644 --- a/sql/expressions.lisp +++ b/sql/expressions.lisp @@ -587,6 +587,9 @@ uninclusive, and the args from that keyword to the end." (write-string "SELECT " *sql-stream*) (when all (write-string "ALL " *sql-stream*)) + (when (and limit (eq :odbc (database-type database))) + (write-string " TOP " *sql-stream*) + (output-sql limit database)) (when (and distinct (not all)) (write-string "DISTINCT " *sql-stream*) (unless (eql t distinct) @@ -656,7 +659,7 @@ uninclusive, and the args from that keyword to the end." (when (cdr order) (write-char #\, *sql-stream*)))) (output-sql order-by database))) - (when limit + (when (and limit (not (eq :odbc (database-type database)))) (write-string " LIMIT " *sql-stream*) (output-sql limit database)) (when offset