X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Ftable.lisp;h=a49ed2adb6d405d0b1e4c0c868f0bd0b57f6a3cf;hb=dfddee2b4dcdd570ba35122076f35a1aa7516c89;hp=72895cfa97f699ff463b253ae2dcf33cdaa4f01e;hpb=b2ff4969e20cce173d403de7542d5bf0e46938d7;p=clsql.git diff --git a/sql/table.lisp b/sql/table.lisp index 72895cf..a49ed2a 100644 --- a/sql/table.lisp +++ b/sql/table.lisp @@ -55,7 +55,7 @@ supports transactions." (execute-command stmt :database database))) (defun drop-table (name &key (if-does-not-exist :error) - (database *default-database*)) + (database *default-database*)) "Drops the table called NAME from DATABASE which defaults to *DEFAULT-DATABASE*. If the table does not exist and IF-DOES-NOT-EXIST is :ignore then DROP-TABLE returns nil whereas @@ -67,10 +67,16 @@ an error is signalled if IF-DOES-NOT-EXIST is :error." (return-from drop-table nil))) (:error t)) - (let ((expr (concatenate 'string "DROP TABLE " table-name - (if (eq :oracle (database-type database)) - " PURGE" - "")))) + + ;; Fixme: move to clsql-oracle + (let ((expr (concatenate 'string "DROP TABLE " table-name))) + (when (and (find-package 'clsql-oracle) + (eq :oracle (database-type database)) + (eql 10 (slot-value database + (intern (symbol-name '#:major-server-version) + (symbol-name '#:clsql-oracle))))) + (setq expr (concatenate 'string expr " PURGE"))) + (execute-command expr :database database)))) (defun list-tables (&key (owner nil) (database *default-database*))