(defun sql-to-c-type (sql-type)
(ecase sql-type
+ ;; Added -10 for MSSQL ntext type and -11 for nvarchar
((#.$SQL_CHAR #.$SQL_VARCHAR #.$SQL_LONGVARCHAR
- #.$SQL_NUMERIC #.$SQL_DECIMAL -8 -9 -10) $SQL_C_CHAR) ;; Added -10 for MSSQL ntext type
+ #.$SQL_NUMERIC #.$sql_decimal -8 -9 -10 -11) $SQL_C_CHAR)
(#.$SQL_INTEGER $SQL_C_SLONG)
(#.$SQL_BIGINT $SQL_C_SBIGINT)
(#.$SQL_SMALLINT $SQL_C_SSHORT)
(with-error-handling (:hstmt hstmt)
(SQLTables hstmt +null-ptr+ 0 +null-ptr+ 0 +null-ptr+ 0 +null-ptr+ 0)))
-(defun %table-statistics (table hstmt &key unique (ensure t))
+(defun %table-statistics (table hstmt &key unique (ensure t)
+ &aux (table (princ-to-string
+ (clsql-sys::unescaped-database-identifier table))))
(with-cstrings ((table-cs table))
- (with-error-handling (:hstmt hstmt)
- (SQLStatistics
- hstmt
- +null-ptr+ 0
- +null-ptr+ 0
- table-cs $SQL_NTS
- (if unique $SQL_INDEX_UNIQUE $SQL_INDEX_ALL)
- (if ensure $SQL_ENSURE $SQL_QUICK)))))
+ (with-error-handling (:hstmt hstmt)
+ (SQLStatistics
+ hstmt
+ +null-ptr+ 0
+ +null-ptr+ 0
+ table-cs $SQL_NTS
+ (if unique $SQL_INDEX_UNIQUE $SQL_INDEX_ALL)
+ (if ensure $SQL_ENSURE $SQL_QUICK)))))
(defun %list-data-sources (henv)
(let ((results nil))