00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __SQL
00024
00025 #define __SQL
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef ODBCVER
00040
00041 #define ODBCVER 0x0351
00042
00043 #endif
00044
00045
00046
00047 #ifndef __SQLTYPES
00048
00049 #include "sqltypes.h"
00050
00051 #endif
00052
00053
00054
00055 #ifdef __cplusplus
00056
00057 extern "C" {
00058
00059 #endif
00060
00061
00062
00063
00064
00065 #define SQL_NULL_DATA (-1)
00066
00067 #define SQL_DATA_AT_EXEC (-2)
00068
00069
00070
00071
00072
00073
00074
00075 #define SQL_SUCCESS 0
00076
00077 #define SQL_SUCCESS_WITH_INFO 1
00078
00079 #if (ODBCVER >= 0x0300)
00080
00081 #define SQL_NO_DATA 100
00082
00083 #endif
00084
00085 #define SQL_ERROR (-1)
00086
00087 #define SQL_INVALID_HANDLE (-2)
00088
00089
00090
00091 #define SQL_STILL_EXECUTING 2
00092
00093 #define SQL_NEED_DATA 99
00094
00095
00096
00097
00098
00099 #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
00100
00101
00102
00103
00104
00105 #define SQL_NTS (-3)
00106
00107 #define SQL_NTSL (-3L)
00108
00109
00110
00111
00112
00113 #define SQL_MAX_MESSAGE_LENGTH 512
00114
00115
00116
00117
00118
00119 #if (ODBCVER >= 0x0300)
00120
00121 #define SQL_DATE_LEN 10
00122
00123 #define SQL_TIME_LEN 8
00124
00125 #define SQL_TIMESTAMP_LEN 19
00126
00127 #endif
00128
00129
00130
00131
00132
00133 #if (ODBCVER >= 0x0300)
00134
00135 #define SQL_HANDLE_ENV 1
00136
00137 #define SQL_HANDLE_DBC 2
00138
00139 #define SQL_HANDLE_STMT 3
00140
00141 #define SQL_HANDLE_DESC 4
00142
00143 #endif
00144
00145
00146
00147
00148
00149 #if (ODBCVER >= 0x0300)
00150
00151 #define SQL_ATTR_OUTPUT_NTS 10001
00152
00153 #endif
00154
00155
00156
00157
00158
00159 #if (ODBCVER >= 0x0300)
00160
00161 #define SQL_ATTR_AUTO_IPD 10001
00162
00163 #define SQL_ATTR_METADATA_ID 10014
00164
00165 #endif
00166
00167
00168
00169
00170
00171 #if (ODBCVER >= 0x0300)
00172
00173 #define SQL_ATTR_APP_ROW_DESC 10010
00174
00175 #define SQL_ATTR_APP_PARAM_DESC 10011
00176
00177 #define SQL_ATTR_IMP_ROW_DESC 10012
00178
00179 #define SQL_ATTR_IMP_PARAM_DESC 10013
00180
00181 #define SQL_ATTR_CURSOR_SCROLLABLE (-1)
00182
00183 #define SQL_ATTR_CURSOR_SENSITIVITY (-2)
00184
00185 #endif
00186
00187
00188
00189
00190
00191 #if (ODBCVER >= 0x0300)
00192
00193 #define SQL_NONSCROLLABLE 0
00194
00195 #define SQL_SCROLLABLE 1
00196
00197 #endif
00198
00199
00200
00201
00202
00203 #if (ODBCVER >= 0x0300)
00204
00205 #define SQL_DESC_COUNT 1001
00206
00207 #define SQL_DESC_TYPE 1002
00208
00209 #define SQL_DESC_LENGTH 1003
00210
00211 #define SQL_DESC_OCTET_LENGTH_PTR 1004
00212
00213 #define SQL_DESC_PRECISION 1005
00214
00215 #define SQL_DESC_SCALE 1006
00216
00217 #define SQL_DESC_DATETIME_INTERVAL_CODE 1007
00218
00219 #define SQL_DESC_NULLABLE 1008
00220
00221 #define SQL_DESC_INDICATOR_PTR 1009
00222
00223 #define SQL_DESC_DATA_PTR 1010
00224
00225 #define SQL_DESC_NAME 1011
00226
00227 #define SQL_DESC_UNNAMED 1012
00228
00229 #define SQL_DESC_OCTET_LENGTH 1013
00230
00231 #define SQL_DESC_ALLOC_TYPE 1099
00232
00233 #endif
00234
00235
00236
00237
00238
00239 #if (ODBCVER >= 0x0300)
00240
00241 #define SQL_DIAG_RETURNCODE 1
00242
00243 #define SQL_DIAG_NUMBER 2
00244
00245 #define SQL_DIAG_ROW_COUNT 3
00246
00247 #define SQL_DIAG_SQLSTATE 4
00248
00249 #define SQL_DIAG_NATIVE 5
00250
00251 #define SQL_DIAG_MESSAGE_TEXT 6
00252
00253 #define SQL_DIAG_DYNAMIC_FUNCTION 7
00254
00255 #define SQL_DIAG_CLASS_ORIGIN 8
00256
00257 #define SQL_DIAG_SUBCLASS_ORIGIN 9
00258
00259 #define SQL_DIAG_CONNECTION_NAME 10
00260
00261 #define SQL_DIAG_SERVER_NAME 11
00262
00263 #define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12
00264
00265 #endif
00266
00267
00268
00269
00270
00271 #if (ODBCVER >= 0x0300)
00272
00273 #define SQL_DIAG_ALTER_DOMAIN 3
00274
00275 #define SQL_DIAG_ALTER_TABLE 4
00276
00277 #define SQL_DIAG_CALL 7
00278
00279 #define SQL_DIAG_CREATE_ASSERTION 6
00280
00281 #define SQL_DIAG_CREATE_CHARACTER_SET 8
00282
00283 #define SQL_DIAG_CREATE_COLLATION 10
00284
00285 #define SQL_DIAG_CREATE_DOMAIN 23
00286
00287 #define SQL_DIAG_CREATE_INDEX (-1)
00288
00289 #define SQL_DIAG_CREATE_SCHEMA 64
00290
00291 #define SQL_DIAG_CREATE_TABLE 77
00292
00293 #define SQL_DIAG_CREATE_TRANSLATION 79
00294
00295 #define SQL_DIAG_CREATE_VIEW 84
00296
00297 #define SQL_DIAG_DELETE_WHERE 19
00298
00299 #define SQL_DIAG_DROP_ASSERTION 24
00300
00301 #define SQL_DIAG_DROP_CHARACTER_SET 25
00302
00303 #define SQL_DIAG_DROP_COLLATION 26
00304
00305 #define SQL_DIAG_DROP_DOMAIN 27
00306
00307 #define SQL_DIAG_DROP_INDEX (-2)
00308
00309 #define SQL_DIAG_DROP_SCHEMA 31
00310
00311 #define SQL_DIAG_DROP_TABLE 32
00312
00313 #define SQL_DIAG_DROP_TRANSLATION 33
00314
00315 #define SQL_DIAG_DROP_VIEW 36
00316
00317 #define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38
00318
00319 #define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81
00320
00321 #define SQL_DIAG_GRANT 48
00322
00323 #define SQL_DIAG_INSERT 50
00324
00325 #define SQL_DIAG_REVOKE 59
00326
00327 #define SQL_DIAG_SELECT_CURSOR 85
00328
00329 #define SQL_DIAG_UNKNOWN_STATEMENT 0
00330
00331 #define SQL_DIAG_UPDATE_WHERE 82
00332
00333 #endif
00334
00335
00336
00337
00338
00339 #define SQL_UNKNOWN_TYPE 0
00340
00341 #define SQL_CHAR 1
00342
00343 #define SQL_NUMERIC 2
00344
00345 #define SQL_DECIMAL 3
00346
00347 #define SQL_INTEGER 4
00348
00349 #define SQL_SMALLINT 5
00350
00351 #define SQL_FLOAT 6
00352
00353 #define SQL_REAL 7
00354
00355 #define SQL_DOUBLE 8
00356
00357 #if (ODBCVER >= 0x0300)
00358
00359 #define SQL_DATETIME 9
00360
00361 #endif
00362
00363 #define SQL_VARCHAR 12
00364
00365
00366
00367
00368
00369 #if (ODBCVER >= 0x0300)
00370
00371 #define SQL_TYPE_DATE 91
00372
00373 #define SQL_TYPE_TIME 92
00374
00375 #define SQL_TYPE_TIMESTAMP 93
00376
00377 #endif
00378
00379
00380
00381
00382
00383 #if (ODBCVER >= 0x0300)
00384
00385 #define SQL_UNSPECIFIED 0
00386
00387 #define SQL_INSENSITIVE 1
00388
00389 #define SQL_SENSITIVE 2
00390
00391 #endif
00392
00393
00394
00395
00396
00397 #define SQL_ALL_TYPES 0
00398
00399
00400
00401
00402
00403 #if (ODBCVER >= 0x0300)
00404
00405 #define SQL_DEFAULT 99
00406
00407 #endif
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417 #if (ODBCVER >= 0x0300)
00418
00419 #define SQL_ARD_TYPE (-99)
00420
00421 #endif
00422
00423
00424
00425
00426
00427 #if (ODBCVER >= 0x0300)
00428
00429 #define SQL_CODE_DATE 1
00430
00431 #define SQL_CODE_TIME 2
00432
00433 #define SQL_CODE_TIMESTAMP 3
00434
00435 #endif
00436
00437
00438
00439
00440
00441 #if (ODBCVER >= 0x0300)
00442
00443 #define SQL_FALSE 0
00444
00445 #define SQL_TRUE 1
00446
00447 #endif
00448
00449
00450
00451
00452
00453 #define SQL_NO_NULLS 0
00454
00455 #define SQL_NULLABLE 1
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465 #define SQL_NULLABLE_UNKNOWN 2
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475 #if (ODBCVER >= 0x0300)
00476
00477 #define SQL_PRED_NONE 0
00478
00479 #define SQL_PRED_CHAR 1
00480
00481 #define SQL_PRED_BASIC 2
00482
00483 #endif
00484
00485
00486
00487
00488
00489 #if (ODBCVER >= 0x0300)
00490
00491 #define SQL_NAMED 0
00492
00493 #define SQL_UNNAMED 1
00494
00495 #endif
00496
00497
00498
00499
00500
00501 #if (ODBCVER >= 0x0300)
00502
00503 #define SQL_DESC_ALLOC_AUTO 1
00504
00505 #define SQL_DESC_ALLOC_USER 2
00506
00507 #endif
00508
00509
00510
00511
00512
00513 #define SQL_CLOSE 0
00514
00515 #define SQL_DROP 1
00516
00517 #define SQL_UNBIND 2
00518
00519 #define SQL_RESET_PARAMS 3
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529 #define SQL_FETCH_NEXT 1
00530
00531 #define SQL_FETCH_FIRST 2
00532
00533
00534
00535
00536
00537 #define SQL_FETCH_LAST 3
00538
00539 #define SQL_FETCH_PRIOR 4
00540
00541 #define SQL_FETCH_ABSOLUTE 5
00542
00543 #define SQL_FETCH_RELATIVE 6
00544
00545
00546
00547
00548
00549 #define SQL_COMMIT 0
00550
00551 #define SQL_ROLLBACK 1
00552
00553
00554
00555
00556
00557 #define SQL_NULL_HENV 0
00558
00559 #define SQL_NULL_HDBC 0
00560
00561 #define SQL_NULL_HSTMT 0
00562
00563 #if (ODBCVER >= 0x0300)
00564
00565 #define SQL_NULL_HDESC 0
00566
00567 #endif
00568
00569
00570
00571
00572
00573 #if (ODBCVER >= 0x0300)
00574
00575 #define SQL_NULL_HANDLE 0L
00576
00577 #endif
00578
00579
00580
00581
00582
00583 #define SQL_SCOPE_CURROW 0
00584
00585 #define SQL_SCOPE_TRANSACTION 1
00586
00587 #define SQL_SCOPE_SESSION 2
00588
00589
00590
00591 #define SQL_PC_UNKNOWN 0
00592
00593 #if (ODBCVER >= 0x0300)
00594
00595 #define SQL_PC_NON_PSEUDO 1
00596
00597 #endif
00598
00599 #define SQL_PC_PSEUDO 2
00600
00601
00602
00603
00604
00605 #if (ODBCVER >= 0x0300)
00606
00607 #define SQL_ROW_IDENTIFIER 1
00608
00609 #endif
00610
00611
00612
00613
00614
00615 #define SQL_INDEX_UNIQUE 0
00616
00617 #define SQL_INDEX_ALL 1
00618
00619
00620
00621
00622
00623 #define SQL_INDEX_CLUSTERED 1
00624
00625 #define SQL_INDEX_HASHED 2
00626
00627 #define SQL_INDEX_OTHER 3
00628
00629
00630
00631
00632
00633 #define SQL_API_SQLALLOCCONNECT 1
00634
00635 #define SQL_API_SQLALLOCENV 2
00636
00637 #if (ODBCVER >= 0x0300)
00638
00639 #define SQL_API_SQLALLOCHANDLE 1001
00640
00641 #endif
00642
00643 #define SQL_API_SQLALLOCSTMT 3
00644
00645 #define SQL_API_SQLBINDCOL 4
00646
00647 #if (ODBCVER >= 0x0300)
00648
00649 #define SQL_API_SQLBINDPARAM 1002
00650
00651 #endif
00652
00653 #define SQL_API_SQLCANCEL 5
00654
00655 #if (ODBCVER >= 0x0300)
00656
00657 #define SQL_API_SQLCLOSECURSOR 1003
00658
00659 #define SQL_API_SQLCOLATTRIBUTE 6
00660
00661 #endif
00662
00663 #define SQL_API_SQLCOLUMNS 40
00664
00665 #define SQL_API_SQLCONNECT 7
00666
00667 #if (ODBCVER >= 0x0300)
00668
00669 #define SQL_API_SQLCOPYDESC 1004
00670
00671 #endif
00672
00673 #define SQL_API_SQLDATASOURCES 57
00674
00675 #define SQL_API_SQLDESCRIBECOL 8
00676
00677 #define SQL_API_SQLDISCONNECT 9
00678
00679 #if (ODBCVER >= 0x0300)
00680
00681 #define SQL_API_SQLENDTRAN 1005
00682
00683 #endif
00684
00685 #define SQL_API_SQLERROR 10
00686
00687 #define SQL_API_SQLEXECDIRECT 11
00688
00689 #define SQL_API_SQLEXECUTE 12
00690
00691 #define SQL_API_SQLFETCH 13
00692
00693 #if (ODBCVER >= 0x0300)
00694
00695 #define SQL_API_SQLFETCHSCROLL 1021
00696
00697 #endif
00698
00699 #define SQL_API_SQLFREECONNECT 14
00700
00701 #define SQL_API_SQLFREEENV 15
00702
00703 #if (ODBCVER >= 0x0300)
00704
00705 #define SQL_API_SQLFREEHANDLE 1006
00706
00707 #endif
00708
00709 #define SQL_API_SQLFREESTMT 16
00710
00711 #if (ODBCVER >= 0x0300)
00712
00713 #define SQL_API_SQLGETCONNECTATTR 1007
00714
00715 #endif
00716
00717 #define SQL_API_SQLGETCONNECTOPTION 42
00718
00719 #define SQL_API_SQLGETCURSORNAME 17
00720
00721 #define SQL_API_SQLGETDATA 43
00722
00723 #if (ODBCVER >= 0x0300)
00724
00725 #define SQL_API_SQLGETDESCFIELD 1008
00726
00727 #define SQL_API_SQLGETDESCREC 1009
00728
00729 #define SQL_API_SQLGETDIAGFIELD 1010
00730
00731 #define SQL_API_SQLGETDIAGREC 1011
00732
00733 #define SQL_API_SQLGETENVATTR 1012
00734
00735 #endif
00736
00737 #define SQL_API_SQLGETFUNCTIONS 44
00738
00739 #define SQL_API_SQLGETINFO 45
00740
00741 #if (ODBCVER >= 0x0300)
00742
00743 #define SQL_API_SQLGETSTMTATTR 1014
00744
00745 #endif
00746
00747 #define SQL_API_SQLGETSTMTOPTION 46
00748
00749 #define SQL_API_SQLGETTYPEINFO 47
00750
00751 #define SQL_API_SQLNUMRESULTCOLS 18
00752
00753 #define SQL_API_SQLPARAMDATA 48
00754
00755 #define SQL_API_SQLPREPARE 19
00756
00757 #define SQL_API_SQLPUTDATA 49
00758
00759 #define SQL_API_SQLROWCOUNT 20
00760
00761 #if (ODBCVER >= 0x0300)
00762
00763 #define SQL_API_SQLSETCONNECTATTR 1016
00764
00765 #endif
00766
00767 #define SQL_API_SQLSETCONNECTOPTION 50
00768
00769 #define SQL_API_SQLSETCURSORNAME 21
00770
00771 #if (ODBCVER >= 0x0300)
00772
00773 #define SQL_API_SQLSETDESCFIELD 1017
00774
00775 #define SQL_API_SQLSETDESCREC 1018
00776
00777 #define SQL_API_SQLSETENVATTR 1019
00778
00779 #endif
00780
00781 #define SQL_API_SQLSETPARAM 22
00782
00783 #if (ODBCVER >= 0x0300)
00784
00785 #define SQL_API_SQLSETSTMTATTR 1020
00786
00787 #endif
00788
00789 #define SQL_API_SQLSETSTMTOPTION 51
00790
00791 #define SQL_API_SQLSPECIALCOLUMNS 52
00792
00793 #define SQL_API_SQLSTATISTICS 53
00794
00795 #define SQL_API_SQLTABLES 54
00796
00797 #define SQL_API_SQLTRANSACT 23
00798
00799
00800
00801
00802
00803 #if (ODBCVER >= 0x0300)
00804
00805 #define SQL_MAX_DRIVER_CONNECTIONS 0
00806
00807 #define SQL_MAXIMUM_DRIVER_CONNECTIONS SQL_MAX_DRIVER_CONNECTIONS
00808
00809 #define SQL_MAX_CONCURRENT_ACTIVITIES 1
00810
00811 #define SQL_MAXIMUM_CONCURRENT_ACTIVITIES SQL_MAX_CONCURRENT_ACTIVITIES
00812
00813 #endif
00814
00815 #define SQL_DATA_SOURCE_NAME 2
00816
00817 #define SQL_FETCH_DIRECTION 8
00818
00819 #define SQL_SERVER_NAME 13
00820
00821 #define SQL_SEARCH_PATTERN_ESCAPE 14
00822
00823 #define SQL_DBMS_NAME 17
00824
00825 #define SQL_DBMS_VER 18
00826
00827 #define SQL_ACCESSIBLE_TABLES 19
00828
00829 #define SQL_ACCESSIBLE_PROCEDURES 20
00830
00831 #define SQL_CURSOR_COMMIT_BEHAVIOR 23
00832
00833 #define SQL_DATA_SOURCE_READ_ONLY 25
00834
00835 #define SQL_DEFAULT_TXN_ISOLATION 26
00836
00837 #define SQL_IDENTIFIER_CASE 28
00838
00839 #define SQL_IDENTIFIER_QUOTE_CHAR 29
00840
00841 #define SQL_MAX_COLUMN_NAME_LEN 30
00842
00843 #define SQL_MAXIMUM_COLUMN_NAME_LENGTH SQL_MAX_COLUMN_NAME_LEN
00844
00845 #define SQL_MAX_CURSOR_NAME_LEN 31
00846
00847 #define SQL_MAXIMUM_CURSOR_NAME_LENGTH SQL_MAX_CURSOR_NAME_LEN
00848
00849 #define SQL_MAX_SCHEMA_NAME_LEN 32
00850
00851 #define SQL_MAXIMUM_SCHEMA_NAME_LENGTH SQL_MAX_SCHEMA_NAME_LEN
00852
00853 #define SQL_MAX_CATALOG_NAME_LEN 34
00854
00855 #define SQL_MAXIMUM_CATALOG_NAME_LENGTH SQL_MAX_CATALOG_NAME_LEN
00856
00857 #define SQL_MAX_TABLE_NAME_LEN 35
00858
00859 #define SQL_SCROLL_CONCURRENCY 43
00860
00861 #define SQL_TXN_CAPABLE 46
00862
00863 #define SQL_TRANSACTION_CAPABLE SQL_TXN_CAPABLE
00864
00865 #define SQL_USER_NAME 47
00866
00867 #define SQL_TXN_ISOLATION_OPTION 72
00868
00869 #define SQL_TRANSACTION_ISOLATION_OPTION SQL_TXN_ISOLATION_OPTION
00870
00871 #define SQL_INTEGRITY 73
00872
00873 #define SQL_GETDATA_EXTENSIONS 81
00874
00875 #define SQL_NULL_COLLATION 85
00876
00877 #define SQL_ALTER_TABLE 86
00878
00879 #define SQL_ORDER_BY_COLUMNS_IN_SELECT 90
00880
00881 #define SQL_SPECIAL_CHARACTERS 94
00882
00883 #define SQL_MAX_COLUMNS_IN_GROUP_BY 97
00884
00885 #define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY SQL_MAX_COLUMNS_IN_GROUP_BY
00886
00887 #define SQL_MAX_COLUMNS_IN_INDEX 98
00888
00889 #define SQL_MAXIMUM_COLUMNS_IN_INDEX SQL_MAX_COLUMNS_IN_INDEX
00890
00891 #define SQL_MAX_COLUMNS_IN_ORDER_BY 99
00892
00893 #define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY SQL_MAX_COLUMNS_IN_ORDER_BY
00894
00895 #define SQL_MAX_COLUMNS_IN_SELECT 100
00896
00897 #define SQL_MAXIMUM_COLUMNS_IN_SELECT SQL_MAX_COLUMNS_IN_SELECT
00898
00899 #define SQL_MAX_COLUMNS_IN_TABLE 101
00900
00901 #define SQL_MAX_INDEX_SIZE 102
00902
00903 #define SQL_MAXIMUM_INDEX_SIZE SQL_MAX_INDEX_SIZE
00904
00905 #define SQL_MAX_ROW_SIZE 104
00906
00907 #define SQL_MAXIMUM_ROW_SIZE SQL_MAX_ROW_SIZE
00908
00909 #define SQL_MAX_STATEMENT_LEN 105
00910
00911 #define SQL_MAXIMUM_STATEMENT_LENGTH SQL_MAX_STATEMENT_LEN
00912
00913 #define SQL_MAX_TABLES_IN_SELECT 106
00914
00915 #define SQL_MAXIMUM_TABLES_IN_SELECT SQL_MAX_TABLES_IN_SELECT
00916
00917 #define SQL_MAX_USER_NAME_LEN 107
00918
00919 #define SQL_MAXIMUM_USER_NAME_LENGTH SQL_MAX_USER_NAME_LEN
00920
00921 #if (ODBCVER >= 0x0300)
00922
00923 #define SQL_OJ_CAPABILITIES 115
00924
00925 #define SQL_OUTER_JOIN_CAPABILITIES SQL_OJ_CAPABILITIES
00926
00927 #endif
00928
00929
00930
00931 #if (ODBCVER >= 0x0300)
00932
00933 #define SQL_XOPEN_CLI_YEAR 10000
00934
00935 #define SQL_CURSOR_SENSITIVITY 10001
00936
00937 #define SQL_DESCRIBE_PARAMETER 10002
00938
00939 #define SQL_CATALOG_NAME 10003
00940
00941 #define SQL_COLLATION_SEQ 10004
00942
00943 #define SQL_MAX_IDENTIFIER_LEN 10005
00944
00945 #define SQL_MAXIMUM_IDENTIFIER_LENGTH SQL_MAX_IDENTIFIER_LEN
00946
00947 #endif
00948
00949
00950
00951
00952
00953 #if (ODBCVER >= 0x0200)
00954
00955 #define SQL_AT_ADD_COLUMN 0x00000001L
00956
00957 #define SQL_AT_DROP_COLUMN 0x00000002L
00958
00959 #endif
00960
00961
00962
00963 #if (ODBCVER >= 0x0300)
00964
00965 #define SQL_AT_ADD_CONSTRAINT 0x00000008L
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003 #endif
01004
01005
01006
01007
01008
01009
01010
01011 #if (ODBCVER >= 0x0300)
01012
01013 #define SQL_AM_NONE 0
01014
01015 #define SQL_AM_CONNECTION 1
01016
01017 #define SQL_AM_STATEMENT 2
01018
01019 #endif
01020
01021
01022
01023
01024
01025 #define SQL_CB_DELETE 0
01026
01027 #define SQL_CB_CLOSE 1
01028
01029 #define SQL_CB_PRESERVE 2
01030
01031
01032
01033
01034
01035 #define SQL_FD_FETCH_NEXT 0x00000001L
01036
01037 #define SQL_FD_FETCH_FIRST 0x00000002L
01038
01039 #define SQL_FD_FETCH_LAST 0x00000004L
01040
01041 #define SQL_FD_FETCH_PRIOR 0x00000008L
01042
01043 #define SQL_FD_FETCH_ABSOLUTE 0x00000010L
01044
01045 #define SQL_FD_FETCH_RELATIVE 0x00000020L
01046
01047
01048
01049
01050
01051 #define SQL_GD_ANY_COLUMN 0x00000001L
01052
01053 #define SQL_GD_ANY_ORDER 0x00000002L
01054
01055
01056
01057
01058
01059 #define SQL_IC_UPPER 1
01060
01061 #define SQL_IC_LOWER 2
01062
01063 #define SQL_IC_SENSITIVE 3
01064
01065 #define SQL_IC_MIXED 4
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077 #if (ODBCVER >= 0x0201)
01078
01079 #define SQL_OJ_LEFT 0x00000001L
01080
01081 #define SQL_OJ_RIGHT 0x00000002L
01082
01083 #define SQL_OJ_FULL 0x00000004L
01084
01085 #define SQL_OJ_NESTED 0x00000008L
01086
01087 #define SQL_OJ_NOT_ORDERED 0x00000010L
01088
01089 #define SQL_OJ_INNER 0x00000020L
01090
01091 #define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L
01092
01093 #endif
01094
01095
01096
01097
01098
01099 #define SQL_SCCO_READ_ONLY 0x00000001L
01100
01101 #define SQL_SCCO_LOCK 0x00000002L
01102
01103 #define SQL_SCCO_OPT_ROWVER 0x00000004L
01104
01105 #define SQL_SCCO_OPT_VALUES 0x00000008L
01106
01107
01108
01109
01110
01111 #define SQL_TC_NONE 0
01112
01113 #define SQL_TC_DML 1
01114
01115 #define SQL_TC_ALL 2
01116
01117 #define SQL_TC_DDL_COMMIT 3
01118
01119 #define SQL_TC_DDL_IGNORE 4
01120
01121
01122
01123
01124
01125 #define SQL_TXN_READ_UNCOMMITTED 0x00000001L
01126
01127 #define SQL_TRANSACTION_READ_UNCOMMITTED SQL_TXN_READ_UNCOMMITTED
01128
01129 #define SQL_TXN_READ_COMMITTED 0x00000002L
01130
01131 #define SQL_TRANSACTION_READ_COMMITTED SQL_TXN_READ_COMMITTED
01132
01133 #define SQL_TXN_REPEATABLE_READ 0x00000004L
01134
01135 #define SQL_TRANSACTION_REPEATABLE_READ SQL_TXN_REPEATABLE_READ
01136
01137 #define SQL_TXN_SERIALIZABLE 0x00000008L
01138
01139 #define SQL_TRANSACTION_SERIALIZABLE SQL_TXN_SERIALIZABLE
01140
01141
01142
01143
01144
01145 #define SQL_NC_HIGH 0
01146
01147 #define SQL_NC_LOW 1
01148
01149
01150
01151 #ifndef RC_INVOKED
01152
01153
01154
01155 SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle,
01156
01157 SQLHDBC *ConnectionHandle);
01158
01159
01160
01161 SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle);
01162
01163
01164
01165 #if (ODBCVER >= 0x0300)
01166
01167 SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType,
01168
01169 SQLHANDLE InputHandle, SQLHANDLE *OutputHandle);
01170
01171 #endif
01172
01173
01174
01175 SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle,
01176
01177 SQLHSTMT *StatementHandle);
01178
01179
01180
01181 SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle,
01182
01183 SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
01184
01185 SQLPOINTER TargetValue, SQLLEN BufferLength,
01186
01187 SQLLEN *StrLen_or_Ind);
01188
01189
01190
01191 #if (ODBCVER >= 0x0300)
01192
01193 SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle,
01194
01195 SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
01196
01197 SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
01198
01199 SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
01200
01201 SQLLEN *StrLen_or_Ind);
01202
01203 #endif
01204
01205
01206
01207 SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle);
01208
01209
01210
01211 #if (ODBCVER >= 0x0300)
01212
01213 SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);
01214
01215
01216
01217 #ifdef _WIN64
01218
01219 SQLRETURN SQL_API SQLColAttribute (SQLHSTMT StatementHandle,
01220
01221 SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
01222
01223 SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
01224
01225 SQLSMALLINT *StringLength, SQLLEN *NumericAttribute);
01226
01227 #else
01228
01229 SQLRETURN SQL_API SQLColAttribute (SQLHSTMT StatementHandle,
01230
01231 SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
01232
01233 SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
01234
01235 SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute);
01236
01237 #endif
01238
01239 #endif
01240
01241
01242
01243
01244
01245 SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle,
01246
01247 SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
01248
01249 SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
01250
01251 SQLCHAR *TableName, SQLSMALLINT NameLength3,
01252
01253 SQLCHAR *ColumnName, SQLSMALLINT NameLength4);
01254
01255
01256
01257
01258
01259 SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle,
01260
01261 SQLCHAR *ServerName, SQLSMALLINT NameLength1,
01262
01263 SQLCHAR *UserName, SQLSMALLINT NameLength2,
01264
01265 SQLCHAR *Authentication, SQLSMALLINT NameLength3);
01266
01267
01268
01269 #if (ODBCVER >= 0x0300)
01270
01271 SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle,
01272
01273 SQLHDESC TargetDescHandle);
01274
01275 #endif
01276
01277
01278
01279 SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle,
01280
01281 SQLUSMALLINT Direction, SQLCHAR *ServerName,
01282
01283 SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
01284
01285 SQLCHAR *Description, SQLSMALLINT BufferLength2,
01286
01287 SQLSMALLINT *NameLength2);
01288
01289
01290
01291 SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle,
01292
01293 SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
01294
01295 SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
01296
01297 SQLSMALLINT *DataType, SQLULEN *ColumnSize,
01298
01299 SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable);
01300
01301
01302
01303 SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle);
01304
01305
01306
01307 #if (ODBCVER >= 0x0300)
01308
01309 SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle,
01310
01311 SQLSMALLINT CompletionType);
01312
01313 #endif
01314
01315
01316
01317 SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle,
01318
01319 SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
01320
01321 SQLCHAR *Sqlstate, SQLINTEGER *NativeError,
01322
01323 SQLCHAR *MessageText, SQLSMALLINT BufferLength,
01324
01325 SQLSMALLINT *TextLength);
01326
01327
01328
01329 SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle,
01330
01331 SQLCHAR *StatementText, SQLINTEGER TextLength);
01332
01333
01334
01335 SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle);
01336
01337
01338
01339 SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle);
01340
01341
01342
01343 #if (ODBCVER >= 0x0300)
01344
01345 SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle,
01346
01347 SQLSMALLINT FetchOrientation, SQLLEN FetchOffset);
01348
01349 #endif
01350
01351
01352
01353 SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle);
01354
01355
01356
01357 SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle);
01358
01359
01360
01361 #if (ODBCVER >= 0x0300)
01362
01363 SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle);
01364
01365 #endif
01366
01367
01368
01369 SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle,
01370
01371 SQLUSMALLINT Option);
01372
01373
01374
01375 #if (ODBCVER >= 0x0300)
01376
01377 SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle,
01378
01379 SQLINTEGER Attribute, SQLPOINTER Value,
01380
01381 SQLINTEGER BufferLength, SQLINTEGER *StringLength);
01382
01383 #endif
01384
01385
01386
01387 SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle,
01388
01389 SQLUSMALLINT Option, SQLPOINTER Value);
01390
01391
01392
01393 SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle,
01394
01395 SQLCHAR *CursorName, SQLSMALLINT BufferLength,
01396
01397 SQLSMALLINT *NameLength);
01398
01399
01400
01401 SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle,
01402
01403 SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
01404
01405 SQLPOINTER TargetValue, SQLLEN BufferLength,
01406
01407 SQLLEN *StrLen_or_Ind);
01408
01409
01410
01411 #if (ODBCVER >= 0x0300)
01412
01413 SQLRETURN SQL_API SQLGetDescField(SQLHDESC DescriptorHandle,
01414
01415 SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
01416
01417 SQLPOINTER Value, SQLINTEGER BufferLength,
01418
01419 SQLINTEGER *StringLength);
01420
01421
01422
01423 SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle,
01424
01425 SQLSMALLINT RecNumber, SQLCHAR *Name,
01426
01427 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
01428
01429 SQLSMALLINT *Type, SQLSMALLINT *SubType,
01430
01431 SQLLEN *Length, SQLSMALLINT *Precision,
01432
01433 SQLSMALLINT *Scale, SQLSMALLINT *Nullable);
01434
01435
01436
01437 SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle,
01438
01439 SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
01440
01441 SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
01442
01443 SQLSMALLINT *StringLength);
01444
01445
01446
01447 SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
01448
01449 SQLSMALLINT RecNumber, SQLCHAR *Sqlstate,
01450
01451 SQLINTEGER *NativeError, SQLCHAR *MessageText,
01452
01453 SQLSMALLINT BufferLength, SQLSMALLINT *TextLength);
01454
01455
01456
01457 SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle,
01458
01459 SQLINTEGER Attribute, SQLPOINTER Value,
01460
01461 SQLINTEGER BufferLength, SQLINTEGER *StringLength);
01462
01463 #endif
01464
01465
01466
01467 SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle,
01468
01469 SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported);
01470
01471
01472
01473 SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle,
01474
01475 SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
01476
01477 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength);
01478
01479
01480
01481 #if (ODBCVER >= 0x0300)
01482
01483 SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle,
01484
01485 SQLINTEGER Attribute, SQLPOINTER Value,
01486
01487 SQLINTEGER BufferLength, SQLINTEGER *StringLength);
01488
01489 #endif
01490
01491
01492
01493 SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle,
01494
01495 SQLUSMALLINT Option, SQLPOINTER Value);
01496
01497
01498
01499 SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle,
01500
01501 SQLSMALLINT DataType);
01502
01503
01504
01505 SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle,
01506
01507 SQLSMALLINT *ColumnCount);
01508
01509
01510
01511 SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle,
01512
01513 SQLPOINTER *Value);
01514
01515
01516
01517 SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle,
01518
01519 SQLCHAR *StatementText, SQLINTEGER TextLength);
01520
01521
01522
01523 SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle,
01524
01525 SQLPOINTER Data, SQLLEN StrLen_or_Ind);
01526
01527
01528
01529 SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle,
01530
01531 SQLLEN* RowCount);
01532
01533
01534
01535 #if (ODBCVER >= 0x0300)
01536
01537 SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle,
01538
01539 SQLINTEGER Attribute, SQLPOINTER Value,
01540
01541 SQLINTEGER StringLength);
01542
01543 #endif
01544
01545
01546
01547 SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle,
01548
01549 SQLUSMALLINT Option, SQLULEN Value);
01550
01551
01552
01553 SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle,
01554
01555 SQLCHAR *CursorName, SQLSMALLINT NameLength);
01556
01557
01558
01559 #if (ODBCVER >= 0x0300)
01560
01561 SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle,
01562
01563 SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
01564
01565 SQLPOINTER Value, SQLINTEGER BufferLength);
01566
01567
01568
01569 SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle,
01570
01571 SQLSMALLINT RecNumber, SQLSMALLINT Type,
01572
01573 SQLSMALLINT SubType, SQLLEN Length,
01574
01575 SQLSMALLINT Precision, SQLSMALLINT Scale,
01576
01577 SQLPOINTER Data, SQLLEN *StringLength,
01578
01579 SQLLEN *Indicator);
01580
01581
01582
01583 SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle,
01584
01585 SQLINTEGER Attribute, SQLPOINTER Value,
01586
01587 SQLINTEGER StringLength);
01588
01589 #endif
01590
01591
01592
01593 SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle,
01594
01595 SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
01596
01597 SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
01598
01599 SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
01600
01601 SQLLEN *StrLen_or_Ind);
01602
01603
01604
01605 #if (ODBCVER >= 0x0300)
01606
01607 SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle,
01608
01609 SQLINTEGER Attribute, SQLPOINTER Value,
01610
01611 SQLINTEGER StringLength);
01612
01613 #endif
01614
01615
01616
01617 SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle,
01618
01619 SQLUSMALLINT Option, SQLULEN Value);
01620
01621
01622
01623 SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle,
01624
01625 SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
01626
01627 SQLSMALLINT NameLength1, SQLCHAR *SchemaName,
01628
01629 SQLSMALLINT NameLength2, SQLCHAR *TableName,
01630
01631 SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
01632
01633 SQLUSMALLINT Nullable);
01634
01635
01636
01637 SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle,
01638
01639 SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
01640
01641 SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
01642
01643 SQLCHAR *TableName, SQLSMALLINT NameLength3,
01644
01645 SQLUSMALLINT Unique, SQLUSMALLINT Reserved);
01646
01647
01648
01649 SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle,
01650
01651 SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
01652
01653 SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
01654
01655 SQLCHAR *TableName, SQLSMALLINT NameLength3,
01656
01657 SQLCHAR *TableType, SQLSMALLINT NameLength4);
01658
01659
01660
01661 SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle,
01662
01663 SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);
01664
01665
01666
01667 #endif
01668
01669
01670
01671 #ifdef __cplusplus
01672
01673 }
01674
01675 #endif
01676
01677 #endif
01678