- Fixed confusion of database-handles (which basically are

non-existent) and descript-handles.
- sql-datatype-* defintion for use with SQLGetTypeInfo() (odbc-sql-get-type-info)
This commit is contained in:
eknauel 2002-09-03 08:18:42 +00:00
parent 23151f3ad1
commit 186f745306
1 changed files with 28 additions and 11 deletions

View File

@ -20,12 +20,12 @@
(define-exported-binding "statement-handle" :statement-handle)
(define-record-type database-handle :database-handle
(really-make-database-handle handle)
database-handle?
(handle database-handle-handle))
(define-record-type descriptor-handle :descriptor-handle
(really-make-descriptor-handle handle)
descriptor-handle?
(handle descriptor-handle-handle))
(define-exported-binding "database-handle" :database-handle)
(define-exported-binding "descriptor-handle" :descriptor-handle)
; record type to store infos from SQLGetDiagRec()
(define-record-type odbc-diag :odbc-diag
@ -41,14 +41,14 @@
(or (environment-handle? thing)
(connection-handle? thing)
(statement-handle? thing)
(database-handle? thing)))
(descriptor-handle? thing)))
(define (odbc-handle handle)
(cond
((environment-handle? handle) (environment-handle-handle handle))
((connection-handle? handle) (connection-handle-handle handle))
((statement-handle? handle) (statement-handle-handle handle))
((database-handle? handle) (database-handle-handle handle))
((descriptor-handle? handle) (descriptor-handle-handle handle))
(else
(error "Expected odbc-handle, got " handle odbc-handle))))
@ -339,6 +339,23 @@
(define sql-oj-inner #x00000020)
(define sql-oj-all-comparison-ops #x00000040)
; ODBC data types for use with odbc_sql_get_type_info
(define sql-datatype-unknown 0)
(define sql-datatype-char 1)
(define sql-datatype-numeric 2)
(define sql-datatype-decimal 3)
(define sql-datatype-integer 4)
(define sql-datatype-smallint 5)
(define sql-datatype-float 6)
(define sql-datatype-real 7)
(define sql-datatype-double 8)
(define sql-datatype-datetime 9)
(define sql-datatype-interval 10)
(define sql-datatype-varchar 12)
(define sql-datatype-date 91)
(define sql-datatype-time 92)
(define sql-datatype-timestamp 93)
;;; ODBC return values
(define sql-error -1)
(define sql-success 0)
@ -374,10 +391,10 @@
(env-handle)
"odbc_alloc_connection_handle")
(define (odbc-alloc-statement-handle database-handle)
(check-arg database-handle? database-handle odbc-alloc-statement-handle)
(really-make-database-handle
(odbc-alloc-statement-handle-internal (database-handle-handle database-handle))))
(define (odbc-alloc-statement-handle conn-handle)
(check-arg connection-handle? conn-handle odbc-alloc-statement-handle)
(really-make-statement-handle
(odbc-alloc-statement-handle-internal (connection-handle-handle conn-handle))))
(import-lambda-definition odbc-alloc-statement-handle-internal
(db-handle)