374 lines
11 KiB
Scheme
374 lines
11 KiB
Scheme
|
|
|
|
;;; some return values
|
|
(define sql-null-data -1)
|
|
(define sql-data-at-exec -2)
|
|
(define sql-success 0)
|
|
(define sql-success-with-info 1)
|
|
(define sql-no-data 100)
|
|
(define sql-error -1)
|
|
(define sql-invalid-handle -2)
|
|
(define sql-still-executing 2)
|
|
(define sql-need-data 99)
|
|
|
|
|
|
;;; use these to indicate string termination to some function
|
|
(define sql-nts -3)
|
|
(define sql-ntsl -3)
|
|
|
|
|
|
;;; maximum message length
|
|
(define sql-max-message-length 512)
|
|
|
|
|
|
;;; date/time length constants
|
|
(define sql-date-len 10)
|
|
(define sql-time-len 8)
|
|
(define sql-timestamp-len 19)
|
|
|
|
|
|
;;; handle type identifiers
|
|
(define sql-handle-env 1)
|
|
(define sql-handle-dbc 2)
|
|
(define sql-handle-stmt 3)
|
|
(define sql-handle-desc 4)
|
|
|
|
|
|
;;; environment attribute
|
|
(define sql-attr-output-nts 10001)
|
|
|
|
|
|
;;; connection attributes
|
|
(define sql-attr-auto-ipd 10001)
|
|
(define sql-attr-metadata-id 10014)
|
|
|
|
|
|
;;; statement attributes
|
|
(define sql-attr-app-row-desc 10010)
|
|
(define sql-attr-app-param-desc 10011)
|
|
(define sql-attr-imp-row-desc 10012)
|
|
(define sql-attr-imp-param-desc 10013)
|
|
(define sql-attr-cursor-scrollable -1)
|
|
(define sql-attr-cursor-sensitivity -2)
|
|
(define sql-nonscrollable 0)
|
|
(define sql-scrollable 1)
|
|
|
|
|
|
;;; identifiers of fields in the SQL descriptor
|
|
(define sql-desc-count 1001)
|
|
(define sql-desc-type 1002)
|
|
(define sql-desc-length 1003)
|
|
(define sql-desc-octet-length-ptr 1004)
|
|
(define sql-desc-precision 1005)
|
|
(define sql-desc-scale 1006)
|
|
(define sql-desc-datetime-interval-code 1007)
|
|
(define sql-desc-nullable 1008)
|
|
(define sql-desc-indicator-ptr 1009)
|
|
(define sql-desc-data-ptr 1010)
|
|
(define sql-desc-name 1011)
|
|
(define sql-desc-unnamed 1012)
|
|
(define sql-desc-octet-length 1013)
|
|
(define sql-desc-alloc-type 1099)
|
|
|
|
|
|
;;; identifiers of fields in the diagnostics area
|
|
(define sql-diag-returncode 1)
|
|
(define sql-diag-number 2)
|
|
(define sql-diag-row-count 3)
|
|
(define sql-diag-sqlstate 4)
|
|
(define sql-diag-native 5)
|
|
(define sql-diag-message-text 6)
|
|
(define sql-diag-dynamic-function 7)
|
|
(define sql-diag-class-origin 8)
|
|
(define sql-diag-subclass-origin 9)
|
|
(define sql-diag-connection-name 10)
|
|
(define sql-diag-server-name 11)
|
|
(define sql-diag-dynamic-function-code 12)
|
|
(define sql-diag-alter-domain 3)
|
|
(define sql-diag-alter-table 4)
|
|
(define sql-diag-call 7)
|
|
(define sql-diag-create-assertion 6)
|
|
(define sql-diag-create-character-set 8)
|
|
(define sql-diag-create-collation 10)
|
|
(define sql-diag-create-domain 23)
|
|
(define sql-diag-create-index -1)
|
|
(define sql-diag-create-schema 64)
|
|
(define sql-diag-create-table 77)
|
|
(define sql-diag-create-translation 79)
|
|
(define sql-diag-create-view 84)
|
|
(define sql-diag-delete-where 19)
|
|
(define sql-diag-drop-assertion 24)
|
|
(define sql-diag-drop-character-set 25)
|
|
(define sql-diag-drop-collation 26)
|
|
(define sql-diag-drop-domain 27)
|
|
(define sql-diag-drop-index -2)
|
|
(define sql-diag-drop-schema 31)
|
|
(define sql-diag-drop-table 32)
|
|
(define sql-diag-drop-translation 33)
|
|
(define sql-diag-drop-view 36)
|
|
(define sql-diag-dynamic-delete-cursor 38)
|
|
(define sql-diag-dynamic-update-cursor 81)
|
|
(define sql-diag-grant 48)
|
|
(define sql-diag-insert 50)
|
|
(define sql-diag-revoke 59)
|
|
(define sql-diag-select-cursor 85)
|
|
(define sql-diag-unknown-statement 0)
|
|
(define sql-diag-update-where 82)
|
|
|
|
|
|
;;; SQL data type codes
|
|
(define sql-unknown-type 0)
|
|
(define sql-char 1)
|
|
(define sql-numeric 2)
|
|
(define sql-decimal 3)
|
|
(define sql-integer 4)
|
|
(define sql-smallint 5)
|
|
(define sql-float 6)
|
|
(define sql-real 7)
|
|
(define sql-double 8)
|
|
(define sql-datetime 9)
|
|
(define sql-varchar 12)
|
|
(define sql-type-date 91)
|
|
(define sql-type-time 92)
|
|
(define sql-type-timestamp 93)
|
|
(define sql-unspecified 0)
|
|
(define sql-insensitive 1)
|
|
(define sql-sensitive 2)
|
|
(define sql-all-types 0)
|
|
(define sql-default 99)
|
|
(define sql-ard-type -99)
|
|
(define sql-code-date 1)
|
|
(define sql-code-time 2)
|
|
(define sql-code-timestamp 3)
|
|
(define sql-false 0)
|
|
(define sql-true 1)
|
|
(define sql-no-nulls 0)
|
|
(define sql-nullable 1)
|
|
(define sql-nullable-unknown 2)
|
|
(define sql-pred-none 0)
|
|
(define sql-pred-char 1)
|
|
(define sql-pred-basic 2)
|
|
(define sql-named 0)
|
|
(define sql-unnamed 1)
|
|
(define sql-desc-alloc-auto 1)
|
|
(define sql-desc-alloc-user 2)
|
|
(define sql-close 0)
|
|
(define sql-drop 1)
|
|
(define sql-unbind 2)
|
|
(define sql-reset-params 3)
|
|
(define sql-fetch-next 1)
|
|
(define sql-fetch-first 2)
|
|
(define sql-fetch-last 3)
|
|
(define sql-fetch-prior 4)
|
|
(define sql-fetch-absolute 5)
|
|
(define sql-fetch-relative 6)
|
|
(define sql-commit 0)
|
|
(define sql-rollback 1)
|
|
(define sql-null-henv 0)
|
|
(define sql-null-hdbc 0)
|
|
(define sql-null-hstmt 0)
|
|
(define sql-null-hdesc 0)
|
|
(define sql-null-handle 0)
|
|
(define sql-scope-currow 0)
|
|
(define sql-scope-transaction 1)
|
|
(define sql-scope-session 2)
|
|
(define sql-pc-unknown 0)
|
|
(define sql-pc-non-pseudo 1)
|
|
(define sql-pc-pseudo 2)
|
|
(define sql-row-identifier 1)
|
|
(define sql-index-unique 0)
|
|
(define sql-index-all 1)
|
|
(define sql-index-clustered 1)
|
|
(define sql-index-hashed 2)
|
|
(define sql-index-other 3)
|
|
(define sql-api-sqlallocconnect 1)
|
|
(define sql-api-sqlallocenv 2)
|
|
(define sql-api-sqlallochandle 1001)
|
|
(define sql-api-sqlallocstmt 3)
|
|
(define sql-api-sqlbindcol 4)
|
|
(define sql-api-sqlbindparam 1002)
|
|
(define sql-api-sqlcancel 5)
|
|
(define sql-api-sqlclosecursor 1003)
|
|
(define sql-api-sqlcolattribute 6)
|
|
(define sql-api-sqlcolumns 40)
|
|
(define sql-api-sqlconnect 7)
|
|
(define sql-api-sqlcopydesc 1004)
|
|
(define sql-api-sqldatasources 57)
|
|
(define sql-api-sqldescribecol 8)
|
|
(define sql-api-sqldisconnect 9)
|
|
(define sql-api-sqlendtran 1005)
|
|
(define sql-api-sqlerror 10)
|
|
(define sql-api-sqlexecdirect 11)
|
|
(define sql-api-sqlexecute 12)
|
|
(define sql-api-sqlfetch 13)
|
|
(define sql-api-sqlfetchscroll 1021)
|
|
(define sql-api-sqlfreeconnect 14)
|
|
(define sql-api-sqlfreeenv 15)
|
|
(define sql-api-sqlfreehandle 1006)
|
|
(define sql-api-sqlfreestmt 16)
|
|
(define sql-api-sqlgetconnectattr 1007)
|
|
(define sql-api-sqlgetcursorname 17)
|
|
(define sql-api-sqlgetdata 43)
|
|
(define sql-api-sqlgetdescfield 1008)
|
|
(define sql-api-sqlgetdescrec 1009)
|
|
(define sql-api-sqlgetdiagfield 1010)
|
|
(define sql-api-sqlgetdiagrec 1011)
|
|
(define sql-api-sqlgetenvattr 1012)
|
|
(define sql-api-sqlgetfunctions 44)
|
|
(define sql-api-sqlgetinfo 45)
|
|
(define sql-api-sqlgetstmtattr 1014)
|
|
(define sql-api-sqlgetstmtoption 46)
|
|
(define sql-api-sqlgettypeinfo 47)
|
|
(define sql-api-sqlnumresultcols 18)
|
|
(define sql-api-sqlparamdata 48)
|
|
(define sql-api-sqlprepare 19)
|
|
(define sql-api-sqlputdata 49)
|
|
(define sql-api-sqlrowcount 20)
|
|
(define sql-api-sqlsetconnectattr 1016)
|
|
(define sql-api-sqlsetconnectoption 50)
|
|
(define sql-api-sqlsetcursorname 21)
|
|
(define sql-api-sqlsetdescfield 1017)
|
|
(define sql-api-sqlsetdescrec 1018)
|
|
(define sql-api-sqlsetenvattr 1019)
|
|
(define sql-api-sqlsetparam 22)
|
|
(define sql-api-sqlsetstmtattr 1020)
|
|
(define sql-api-sqlsetstmtoption 51)
|
|
(define sql-api-sqlspecialcolumns 52)
|
|
(define sql-api-sqlstatistics 53)
|
|
(define sql-api-sqltables 54)
|
|
(define sql-api-sqltransact 23)
|
|
|
|
|
|
;;; Information requested by SQLGetInfo()
|
|
(define sql-max-driver-connections 0)
|
|
(define sql-maximum-driver-connections 0)
|
|
(define sql-max-concurrent-activities 1)
|
|
(define sql-maximum-driver-connections 0)
|
|
(define sql-data-source-name 2)
|
|
(define sql-fetch-direction 8)
|
|
(define sql-server-name 13)
|
|
(define sql-search-pattern-escape 14)
|
|
(define sql-dbms-name 17)
|
|
(define sql-dbms-ver 18)
|
|
(define sql-accessible-tables 19)
|
|
(define sql-accessible-procedures 20)
|
|
(define sql-cursor-commit-behavior 23)
|
|
(define sql-data-source-read-only 25)
|
|
(define sql-default-txn-isolation 26)
|
|
(define sql-identifier-case 28)
|
|
(define sql-identifier-quote-char 29)
|
|
(define sql-max-column-name-len 30)
|
|
(define sql-maximum-column-name-length 30)
|
|
(define sql-max-cursor-name-len 31)
|
|
(define sql-maximum-cursor-name-length 31)
|
|
(define sql-max-schema-name-len 32)
|
|
(define sql-maximum-schema-name-length 32)
|
|
(define sql-max-catalog-name-len 34)
|
|
(define sql-maximum-catalog-name-length 34)
|
|
(define sql-max-table-name-len 35)
|
|
(define sql-scroll-concurrency 43)
|
|
(define sql-txn-capable 46)
|
|
(define sql-transaction-capable 46)
|
|
(define sql-user-name 47)
|
|
(define sql-txn-isolation-option 72)
|
|
(define sql-transaction-isolation-option 72)
|
|
(define sql-integrity 73)
|
|
(define sql-getdata-extensions 81)
|
|
(define sql-null-collation 85)
|
|
(define sql-alter-table 86)
|
|
(define sql-order-by-columns-in-select 90)
|
|
(define sql-special-characters 94)
|
|
(define sql-max-columns-in-group-by 97)
|
|
(define sql-maximum-columns-in-group-by 97)
|
|
(define sql-max-columns-in-index 98)
|
|
(define sql-maximum-columns-in-index 98)
|
|
(define sql-max-columns-in-order-by 99)
|
|
(define sql-maximum-columns-in-order-by 99)
|
|
(define sql-max-columns-in-select 100)
|
|
(define sql-maximum-columns-in-select 100)
|
|
(define sql-max-columns-in-table 101)
|
|
(define sql-max-index-size 102)
|
|
(define sql-maximum-index-size 102)
|
|
(define sql-max-row-size 104)
|
|
(define sql-maximum-row-size 104)
|
|
(define sql-max-statement-len 105)
|
|
(define sql-maximum-statement-length 105)
|
|
(define sql-max-tables-in-select 106)
|
|
(define sql-maximum-tables-in-select 106)
|
|
(define sql-max-user-name-len 107)
|
|
(define sql-maximum-user-name-length 107)
|
|
(define sql-oj-capabilities 115)
|
|
(define sql-outer-join-capabilities 115)
|
|
(define sql-xopen-cli-year 10000)
|
|
(define sql-cursor-sensitivity 10001)
|
|
(define sql-describe-parameter 10002)
|
|
(define sql-catalog-name 10003)
|
|
(define sql-collation-seq 10004)
|
|
(define sql-max-identifier-len 10005)
|
|
(define sql-maximum-identifier-length 10005)
|
|
(define sql-at-add-column 1)
|
|
(define sql-at-drop-column 2)
|
|
(define sql-at-add-constraint 8)
|
|
|
|
|
|
;;; SQL_ASYNC_MODE values
|
|
(define sql-am-none 0)
|
|
(define sql-am-connection 1)
|
|
(define sql-am-statement 2)
|
|
|
|
|
|
;;; SQL_CURSOR_COMMIT_BEHAVIOR values
|
|
(define sql-cb-delete 0)
|
|
(define sql-cb-close 1)
|
|
(define sql-cb-preserve 2)
|
|
|
|
|
|
;;; SQL_FETCH_DIRECTION bitmasks
|
|
(define sql-fd-fetch-next 1)
|
|
(define sql-fd-fetch-first 2)
|
|
(define sql-fd-fetch-last 4)
|
|
(define sql-fd-fetch-prior 8)
|
|
(define sql-fd-fetch-absolute 16)
|
|
(define sql-fd-fetch-relative 32)
|
|
|
|
|
|
;;; SQL_GETDATA_EXTENSIONS bitmasks
|
|
(define sql-gd-any-column 1)
|
|
(define sql-gd-any-order 2)
|
|
|
|
|
|
;;; SQL_IDENTIFIER_CASE values
|
|
(define sql-ic-upper 1)
|
|
(define sql-ic-lower 2)
|
|
(define sql-ic-sensitive 3)
|
|
(define sql-ic-mixed 4)
|
|
|
|
|
|
;;; SQL_OJ_CAPABILITIES bitmasks
|
|
(define sql-oj-left 1)
|
|
(define sql-oj-right 2)
|
|
(define sql-oj-full 4)
|
|
(define sql-oj-nested 8)
|
|
(define sql-oj-not-ordered 16)
|
|
(define sql-oj-inner 32)
|
|
(define sql-oj-all-comparison-ops 64)
|
|
(define sql-scco-read-only 1)
|
|
(define sql-scco-lock 2)
|
|
(define sql-scco-opt-rowver 4)
|
|
(define sql-scco-opt-values 8)
|
|
(define sql-tc-none 0)
|
|
(define sql-tc-dml 1)
|
|
(define sql-tc-all 2)
|
|
(define sql-tc-ddl-commit 3)
|
|
(define sql-tc-ddl-ignore 4)
|
|
(define sql-txn-read-uncommitted 1)
|
|
(define sql-transaction-read-uncommitted 1)
|
|
(define sql-txn-read-uncommitted 1)
|
|
(define sql-transaction-read-committed 2)
|
|
(define sql-txn-repeatable-read 4)
|
|
(define sql-transaction-repeatable-read 4)
|
|
(define sql-txn-serializable 8)
|
|
(define sql-transaction-serializable 8)
|
|
(define sql-nc-high 0)
|
|
(define sql-nc-low 1)
|