r9119: Automated commit for Debian build of clsql upstream-version-2.9.2
[clsql.git] / db-aodbc / aodbc-sql.lisp
index 09815914083be6190bab705eeb1ce986027ec372..7d49c7d22ad5e12b60a90754e6528c4220e0ab43 100644 (file)
   #+aodbc-v2
   (multiple-value-bind (rows col-names)
       (dbi:list-all-database-tables :db (database-aodbc-conn database))
-    (let ((pos (position "TABLE_NAME" col-names :test #'string-equal)))
-      (when pos
-       (loop for row in rows
-           collect (nth pos row))))))
-
+    (declare (ignore col-names))
+      ;; TABLE_SCHEM is hard-coded in second column by ODBC Driver Manager
+      ;; TABLE_NAME in third column, TABLE_TYPE in fourth column
+      (loop for row in rows
+         when (and (not (string-equal "information_schema" (nth 1 row)))
+                   (string-equal "TABLE" (nth 3 row)))
+         collect (nth 2 row))))
 
 (defmethod database-list-attributes ((table string) (database aodbc-database)
                                      &key (owner nil))
 (defmethod database-probe (connection-spec (type (eql :aodbc)))
   (warn "Not implemented."))
 
+;;; Backend capabilities
+
+(defmethod db-backend-has-create/destroy-db? ((db-type (eql :aodbc)))
+  nil)
+
 #+ignore                      
 (when (clsql-base-sys:database-type-library-loaded :aodbc)
   (clsql-base-sys:initialize-database-type :database-type :aodbc))