home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1999 March / CDW0399.iso / Demos / FileM_4.1 / FMPROCD.Z / DATA1.CAB / Header / Sql.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-02  |  29.6 KB  |  838 lines

  1. /*****************************************************************
  2. ** SQL.H - This is the the main include for ODBC Core functions.
  3. **
  4. ** preconditions:
  5. **      #include "windows.h"
  6. **
  7. ** (C) Copyright 1990 - 1997 By Microsoft Corp.
  8. **
  9. **      Updated 5/12/93 for 2.00 specification
  10. **      Updated 5/23/94 for 2.01 specification
  11. **      Updated 11/10/94 for 2.10 specification
  12. **      Updated 04/10/95 for 2.50 specification
  13. **      Updated 6/6/95  for 3.00 specification
  14. *********************************************************************/
  15.  
  16.  
  17. #ifndef __SQL
  18. #define __SQL
  19.  
  20. /*
  21. * ODBCVER  ODBC version number (0x0350).   To exclude
  22. *          definitions introduced in version 3.5 (or above)
  23. *          #define ODBCVER 0x0300 before #including <sql.h>
  24. */
  25. #ifndef ODBCVER
  26. #define ODBCVER 0x0350
  27. #endif
  28.  
  29. #ifndef __SQLTYPES
  30. #include "sqltypes.h"
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {             /* Assume C declarations for C++   */
  35. #endif  /* __cplusplus */
  36.  
  37. /* special length/indicator values */
  38. #define SQL_NULL_DATA             (-1)
  39. #define SQL_DATA_AT_EXEC          (-2)
  40.  
  41.  
  42. /* return values from functions */
  43. #define SQL_SUCCESS                0
  44. #define SQL_SUCCESS_WITH_INFO      1
  45. #if (ODBCVER >= 0x0300)
  46. #define SQL_NO_DATA              100
  47. #endif
  48. #define SQL_ERROR                 (-1)
  49. #define SQL_INVALID_HANDLE        (-2)
  50.  
  51. #define SQL_STILL_EXECUTING        2
  52. #define SQL_NEED_DATA             99
  53.  
  54. /* test for SQL_SUCCESS or SQL_SUCCESS_WITH_INFO */
  55. #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
  56.  
  57. /* flags for null-terminated string */
  58. #define SQL_NTS                   (-3)
  59. #define SQL_NTSL                  (-3L)
  60.  
  61. /* maximum message length */
  62. #define SQL_MAX_MESSAGE_LENGTH   512
  63.  
  64. /* date/time length constants */
  65. #if (ODBCVER >= 0x0300)
  66. #define SQL_DATE_LEN           10
  67. #define SQL_TIME_LEN            8  /* add P+1 if precision is nonzero */
  68. #define SQL_TIMESTAMP_LEN      19  /* add P+1 if precision is nonzero */
  69. #endif
  70.  
  71. /* handle type identifiers */
  72. #if (ODBCVER >= 0x0300)
  73. #define SQL_HANDLE_ENV             1
  74. #define SQL_HANDLE_DBC             2
  75. #define SQL_HANDLE_STMT            3
  76. #define SQL_HANDLE_DESC            4
  77. #endif
  78.  
  79. /* environment attribute */
  80. #if (ODBCVER >= 0x0300)
  81. #define SQL_ATTR_OUTPUT_NTS    10001
  82. #endif
  83.  
  84. /* connection attributes */
  85. #if (ODBCVER >= 0x0300)
  86. #define SQL_ATTR_AUTO_IPD      10001
  87. #define SQL_ATTR_METADATA_ID   10014
  88. #endif  /* ODBCVER >= 0x0300 */
  89.  
  90. /* statement attributes */
  91. #if (ODBCVER >= 0x0300)
  92. #define SQL_ATTR_APP_ROW_DESC       10010
  93. #define SQL_ATTR_APP_PARAM_DESC     10011
  94. #define SQL_ATTR_IMP_ROW_DESC       10012
  95. #define SQL_ATTR_IMP_PARAM_DESC     10013
  96. #define SQL_ATTR_CURSOR_SCROLLABLE  (-1)
  97. #define SQL_ATTR_CURSOR_SENSITIVITY (-2)
  98. #endif
  99.  
  100. /* SQL_ATTR_CURSOR_SCROLLABLE values */
  101. #if (ODBCVER >= 0x0300)
  102. #define SQL_NONSCROLLABLE            0
  103. #define SQL_SCROLLABLE                1
  104. #endif  /* ODBCVER >= 0x0300 */
  105.  
  106. /* identifiers of fields in the SQL descriptor */
  107. #if (ODBCVER >= 0x0300)
  108. #define SQL_DESC_COUNT                  1001
  109. #define SQL_DESC_TYPE                   1002
  110. #define SQL_DESC_LENGTH                 1003
  111. #define SQL_DESC_OCTET_LENGTH_PTR       1004
  112. #define SQL_DESC_PRECISION              1005
  113. #define SQL_DESC_SCALE                  1006
  114. #define SQL_DESC_DATETIME_INTERVAL_CODE 1007
  115. #define SQL_DESC_NULLABLE               1008
  116. #define SQL_DESC_INDICATOR_PTR          1009
  117. #define SQL_DESC_DATA_PTR               1010
  118. #define SQL_DESC_NAME                   1011
  119. #define SQL_DESC_UNNAMED                1012
  120. #define SQL_DESC_OCTET_LENGTH           1013
  121. #define SQL_DESC_ALLOC_TYPE             1099
  122. #endif
  123.  
  124. /* identifiers of fields in the diagnostics area */
  125. #if (ODBCVER >= 0x0300)
  126. #define SQL_DIAG_RETURNCODE        1
  127. #define SQL_DIAG_NUMBER            2
  128. #define SQL_DIAG_ROW_COUNT         3
  129. #define SQL_DIAG_SQLSTATE          4
  130. #define SQL_DIAG_NATIVE            5
  131. #define SQL_DIAG_MESSAGE_TEXT      6
  132. #define SQL_DIAG_DYNAMIC_FUNCTION  7
  133. #define SQL_DIAG_CLASS_ORIGIN      8
  134. #define SQL_DIAG_SUBCLASS_ORIGIN   9
  135. #define SQL_DIAG_CONNECTION_NAME  10
  136. #define SQL_DIAG_SERVER_NAME      11
  137. #define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12
  138. #endif
  139.  
  140. /* dynamic function codes */
  141. #if (ODBCVER >= 0x0300)
  142. #define SQL_DIAG_ALTER_DOMAIN            3
  143. #define SQL_DIAG_ALTER_TABLE            4
  144. #define SQL_DIAG_CALL                    7
  145. #define SQL_DIAG_CREATE_ASSERTION        6
  146. #define SQL_DIAG_CREATE_CHARACTER_SET    8
  147. #define SQL_DIAG_CREATE_COLLATION        10
  148. #define SQL_DIAG_CREATE_DOMAIN            23
  149. #define SQL_DIAG_CREATE_INDEX          (-1)
  150. #define SQL_DIAG_CREATE_SCHEMA            64
  151. #define SQL_DIAG_CREATE_TABLE          77
  152. #define SQL_DIAG_CREATE_TRANSLATION        79
  153. #define SQL_DIAG_CREATE_VIEW           84
  154. #define SQL_DIAG_DELETE_WHERE          19
  155. #define    SQL_DIAG_DROP_ASSERTION            24
  156. #define    SQL_DIAG_DROP_CHARACTER_SET        25
  157. #define    SQL_DIAG_DROP_COLLATION            26
  158. #define    SQL_DIAG_DROP_DOMAIN            27
  159. #define SQL_DIAG_DROP_INDEX            (-2)
  160. #define SQL_DIAG_DROP_SCHEMA            31
  161. #define SQL_DIAG_DROP_TABLE            32
  162. #define SQL_DIAG_DROP_TRANSLATION      33
  163. #define SQL_DIAG_DROP_VIEW             36
  164. #define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38
  165. #define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81
  166. #define SQL_DIAG_GRANT                 48
  167. #define SQL_DIAG_INSERT                50
  168. #define SQL_DIAG_REVOKE                59
  169. #define SQL_DIAG_SELECT_CURSOR         85
  170. #define SQL_DIAG_UNKNOWN_STATEMENT      0
  171. #define SQL_DIAG_UPDATE_WHERE          82
  172. #endif  /* ODBCVER >= 0x0300 */
  173.  
  174. /* SQL data type codes */
  175. #define    SQL_UNKNOWN_TYPE    0
  176. #define SQL_CHAR            1
  177. #define SQL_NUMERIC         2
  178. #define SQL_DECIMAL         3
  179. #define SQL_INTEGER         4
  180. #define SQL_SMALLINT        5
  181. #define SQL_FLOAT           6
  182. #define SQL_REAL            7
  183. #define SQL_DOUBLE          8
  184. #if (ODBCVER >= 0x0300)
  185. #define SQL_DATETIME        9
  186. #endif
  187. #define SQL_VARCHAR        12
  188.  
  189. /* One-parameter shortcuts for date/time data types */
  190. #if (ODBCVER >= 0x0300)
  191. #define SQL_TYPE_DATE      91
  192. #define SQL_TYPE_TIME      92
  193. #define SQL_TYPE_TIMESTAMP 93
  194. #endif
  195.  
  196. /* Statement attribute values for cursor sensitivity */
  197. #if (ODBCVER >= 0x0300)
  198. #define SQL_UNSPECIFIED     0
  199. #define SQL_INSENSITIVE     1
  200. #define SQL_SENSITIVE       2
  201. #endif
  202.  
  203. /* GetTypeInfo() request for all data types */
  204. #define SQL_ALL_TYPES       0
  205.  
  206. /* Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() */
  207. #if (ODBCVER >= 0x0300)
  208. #define SQL_DEFAULT        99
  209. #endif
  210.  
  211. /* SQLGetData() code indicating that the application row descriptor
  212.  * specifies the data type
  213.  */
  214. #if (ODBCVER >= 0x0300)
  215. #define SQL_ARD_TYPE      (-99)
  216. #endif
  217.  
  218. /* SQL date/time type subcodes */
  219. #if (ODBCVER >= 0x0300)
  220. #define SQL_CODE_DATE       1
  221. #define SQL_CODE_TIME       2
  222. #define SQL_CODE_TIMESTAMP  3
  223. #endif
  224.  
  225. /* CLI option values */
  226. #if (ODBCVER >= 0x0300)
  227. #define SQL_FALSE           0
  228. #define SQL_TRUE            1
  229. #endif
  230.  
  231. /* values of NULLABLE field in descriptor */
  232. #define SQL_NO_NULLS        0
  233. #define SQL_NULLABLE        1
  234.  
  235. /* Value returned by SQLGetTypeInfo() to denote that it is
  236.  * not known whether or not a data type supports null values.
  237.  */
  238. #define SQL_NULLABLE_UNKNOWN  2
  239.  
  240. /* Values returned by SQLGetTypeInfo() to show WHERE clause
  241.  * supported
  242.  */
  243. #if (ODBCVER >= 0x0300)
  244. #define SQL_PRED_NONE     0
  245. #define SQL_PRED_CHAR     1
  246. #define SQL_PRED_BASIC    2
  247. #endif
  248.  
  249. /* values of UNNAMED field in descriptor */
  250. #if (ODBCVER >= 0x0300)
  251. #define SQL_NAMED           0
  252. #define SQL_UNNAMED         1
  253. #endif
  254.  
  255. /* values of ALLOC_TYPE field in descriptor */
  256. #if (ODBCVER >= 0x0300)
  257. #define SQL_DESC_ALLOC_AUTO 1
  258. #define SQL_DESC_ALLOC_USER 2
  259. #endif
  260.  
  261. /* FreeStmt() options */
  262. #define SQL_CLOSE           0
  263. #define SQL_DROP            1
  264. #define SQL_UNBIND          2
  265. #define SQL_RESET_PARAMS    3
  266.  
  267. /* Codes used for FetchOrientation in SQLFetchScroll(), 
  268.    and in SQLDataSources() 
  269. */
  270. #define SQL_FETCH_NEXT      1
  271. #define SQL_FETCH_FIRST     2
  272.  
  273. /* Other codes used for FetchOrientation in SQLFetchScroll() */
  274. #define SQL_FETCH_LAST      3
  275. #define SQL_FETCH_PRIOR     4
  276. #define SQL_FETCH_ABSOLUTE  5
  277. #define SQL_FETCH_RELATIVE  6
  278.  
  279. /* SQLEndTran() options */
  280. #define SQL_COMMIT          0
  281. #define SQL_ROLLBACK        1
  282.  
  283. /* null handles returned by SQLAllocHandle() */
  284. #define SQL_NULL_HENV       0
  285. #define SQL_NULL_HDBC       0
  286. #define SQL_NULL_HSTMT      0
  287. #if (ODBCVER >= 0x0300)
  288. #define SQL_NULL_HDESC      0
  289. #endif
  290.  
  291. /* null handle used in place of parent handle when allocating HENV */
  292. #if (ODBCVER >= 0x0300)
  293. #define SQL_NULL_HANDLE     0L
  294. #endif
  295.  
  296. /* Values that may appear in the result set of SQLSpecialColumns() */
  297. #define SQL_SCOPE_CURROW    0
  298. #define SQL_SCOPE_TRANSACTION 1
  299. #define SQL_SCOPE_SESSION   2
  300.  
  301. #define SQL_PC_UNKNOWN      0
  302. #if (ODBCVER >= 0x0300)
  303. #define SQL_PC_NON_PSEUDO   1
  304. #endif
  305. #define SQL_PC_PSEUDO       2
  306.  
  307. /* Reserved value for the IdentifierType argument of SQLSpecialColumns() */
  308. #if (ODBCVER >= 0x0300)
  309. #define SQL_ROW_IDENTIFIER  1
  310. #endif
  311.  
  312. /* Reserved values for UNIQUE argument of SQLStatistics() */
  313. #define SQL_INDEX_UNIQUE    0
  314. #define SQL_INDEX_ALL       1
  315.  
  316. /* Values that may appear in the result set of SQLStatistics() */
  317. #define SQL_INDEX_CLUSTERED 1
  318. #define SQL_INDEX_HASHED    2
  319. #define SQL_INDEX_OTHER     3
  320.  
  321. /* SQLGetFunctions() values to identify ODBC APIs */
  322. #define SQL_API_SQLALLOCCONNECT         1
  323. #define SQL_API_SQLALLOCENV             2
  324. #if (ODBCVER >= 0x0300)
  325. #define SQL_API_SQLALLOCHANDLE       1001
  326. #endif
  327. #define SQL_API_SQLALLOCSTMT            3
  328. #define SQL_API_SQLBINDCOL              4
  329. #if (ODBCVER >= 0x0300)
  330. #define SQL_API_SQLBINDPARAM         1002
  331. #endif
  332. #define SQL_API_SQLCANCEL               5
  333. #if (ODBCVER >= 0x0300)
  334. #define SQL_API_SQLCLOSECURSOR       1003
  335. #define SQL_API_SQLCOLATTRIBUTE         6
  336. #endif
  337. #define SQL_API_SQLCOLUMNS             40
  338. #define SQL_API_SQLCONNECT              7
  339. #if (ODBCVER >= 0x0300)
  340. #define SQL_API_SQLCOPYDESC          1004
  341. #endif
  342. #define SQL_API_SQLDATASOURCES         57
  343. #define SQL_API_SQLDESCRIBECOL          8
  344. #define SQL_API_SQLDISCONNECT           9
  345. #if (ODBCVER >= 0x0300)
  346. #define SQL_API_SQLENDTRAN           1005
  347. #endif
  348. #define SQL_API_SQLERROR               10
  349. #define SQL_API_SQLEXECDIRECT          11
  350. #define SQL_API_SQLEXECUTE             12
  351. #define SQL_API_SQLFETCH               13
  352. #if (ODBCVER >= 0x0300)
  353. #define SQL_API_SQLFETCHSCROLL       1021
  354. #endif
  355. #define SQL_API_SQLFREECONNECT         14
  356. #define SQL_API_SQLFREEENV             15
  357. #if (ODBCVER >= 0x0300)
  358. #define SQL_API_SQLFREEHANDLE        1006
  359. #endif
  360. #define SQL_API_SQLFREESTMT            16
  361. #if (ODBCVER >= 0x0300)
  362. #define SQL_API_SQLGETCONNECTATTR    1007
  363. #endif
  364. #define SQL_API_SQLGETCONNECTOPTION    42
  365. #define SQL_API_SQLGETCURSORNAME       17
  366. #define SQL_API_SQLGETDATA             43
  367. #if (ODBCVER >= 0x0300)
  368. #define SQL_API_SQLGETDESCFIELD      1008
  369. #define SQL_API_SQLGETDESCREC        1009
  370. #define SQL_API_SQLGETDIAGFIELD      1010
  371. #define SQL_API_SQLGETDIAGREC        1011
  372. #define SQL_API_SQLGETENVATTR        1012
  373. #endif
  374. #define SQL_API_SQLGETFUNCTIONS        44
  375. #define SQL_API_SQLGETINFO             45
  376. #if (ODBCVER >= 0x0300)
  377. #define SQL_API_SQLGETSTMTATTR       1014
  378. #endif
  379. #define SQL_API_SQLGETSTMTOPTION       46
  380. #define SQL_API_SQLGETTYPEINFO         47
  381. #define SQL_API_SQLNUMRESULTCOLS       18
  382. #define SQL_API_SQLPARAMDATA           48
  383. #define SQL_API_SQLPREPARE             19
  384. #define SQL_API_SQLPUTDATA             49
  385. #define SQL_API_SQLROWCOUNT            20
  386. #if (ODBCVER >= 0x0300)
  387. #define SQL_API_SQLSETCONNECTATTR    1016
  388. #endif
  389. #define SQL_API_SQLSETCONNECTOPTION    50
  390. #define SQL_API_SQLSETCURSORNAME       21
  391. #if (ODBCVER >= 0x0300)
  392. #define SQL_API_SQLSETDESCFIELD      1017
  393. #define SQL_API_SQLSETDESCREC        1018
  394. #define SQL_API_SQLSETENVATTR        1019
  395. #endif
  396. #define SQL_API_SQLSETPARAM            22
  397. #if (ODBCVER >= 0x0300)
  398. #define SQL_API_SQLSETSTMTATTR       1020
  399. #endif
  400. #define SQL_API_SQLSETSTMTOPTION       51
  401. #define SQL_API_SQLSPECIALCOLUMNS      52
  402. #define SQL_API_SQLSTATISTICS          53
  403. #define SQL_API_SQLTABLES              54
  404. #define SQL_API_SQLTRANSACT            23
  405.  
  406. /* Information requested by SQLGetInfo() */
  407. #if (ODBCVER >= 0x0300)
  408. #define SQL_MAX_DRIVER_CONNECTIONS           0
  409. #define SQL_MAXIMUM_DRIVER_CONNECTIONS        SQL_MAX_DRIVER_CONNECTIONS
  410. #define SQL_MAX_CONCURRENT_ACTIVITIES        1
  411. #define SQL_MAXIMUM_CONCURRENT_ACTIVITIES    SQL_MAX_CONCURRENT_ACTIVITIES
  412. #endif
  413. #define SQL_DATA_SOURCE_NAME                 2
  414. #define SQL_FETCH_DIRECTION                  8
  415. #define SQL_SERVER_NAME                     13
  416. #define SQL_SEARCH_PATTERN_ESCAPE           14
  417. #define SQL_DBMS_NAME                       17
  418. #define SQL_DBMS_VER                        18
  419. #define SQL_ACCESSIBLE_TABLES               19
  420. #define SQL_ACCESSIBLE_PROCEDURES            20
  421. #define SQL_CURSOR_COMMIT_BEHAVIOR          23
  422. #define SQL_DATA_SOURCE_READ_ONLY           25
  423. #define SQL_DEFAULT_TXN_ISOLATION           26
  424. #define SQL_IDENTIFIER_CASE                 28
  425. #define SQL_IDENTIFIER_QUOTE_CHAR           29
  426. #define SQL_MAX_COLUMN_NAME_LEN             30
  427. #define SQL_MAXIMUM_COLUMN_NAME_LENGTH        SQL_MAX_COLUMN_NAME_LEN
  428. #define SQL_MAX_CURSOR_NAME_LEN             31
  429. #define SQL_MAXIMUM_CURSOR_NAME_LENGTH        SQL_MAX_CURSOR_NAME_LEN
  430. #define SQL_MAX_SCHEMA_NAME_LEN             32
  431. #define SQL_MAXIMUM_SCHEMA_NAME_LENGTH        SQL_MAX_SCHEMA_NAME_LEN
  432. #define SQL_MAX_CATALOG_NAME_LEN            34
  433. #define SQL_MAXIMUM_CATALOG_NAME_LENGTH        SQL_MAX_CATALOG_NAME_LEN
  434. #define SQL_MAX_TABLE_NAME_LEN              35
  435. #define SQL_SCROLL_CONCURRENCY              43
  436. #define SQL_TXN_CAPABLE                     46
  437. #define SQL_TRANSACTION_CAPABLE                SQL_TXN_CAPABLE
  438. #define SQL_USER_NAME                       47
  439. #define SQL_TXN_ISOLATION_OPTION            72
  440. #define SQL_TRANSACTION_ISOLATION_OPTION    SQL_TXN_ISOLATION_OPTION
  441. #define SQL_INTEGRITY                       73
  442. #define SQL_GETDATA_EXTENSIONS              81
  443. #define SQL_NULL_COLLATION                  85
  444. #define SQL_ALTER_TABLE                     86
  445. #define SQL_ORDER_BY_COLUMNS_IN_SELECT      90
  446. #define SQL_SPECIAL_CHARACTERS              94
  447. #define SQL_MAX_COLUMNS_IN_GROUP_BY         97
  448. #define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY        SQL_MAX_COLUMNS_IN_GROUP_BY
  449. #define SQL_MAX_COLUMNS_IN_INDEX            98
  450. #define SQL_MAXIMUM_COLUMNS_IN_INDEX        SQL_MAX_COLUMNS_IN_INDEX
  451. #define SQL_MAX_COLUMNS_IN_ORDER_BY         99
  452. #define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY        SQL_MAX_COLUMNS_IN_ORDER_BY
  453. #define SQL_MAX_COLUMNS_IN_SELECT          100
  454. #define SQL_MAXIMUM_COLUMNS_IN_SELECT       SQL_MAX_COLUMNS_IN_SELECT
  455. #define SQL_MAX_COLUMNS_IN_TABLE           101
  456. #define SQL_MAX_INDEX_SIZE                 102
  457. #define SQL_MAXIMUM_INDEX_SIZE               SQL_MAX_INDEX_SIZE
  458. #define SQL_MAX_ROW_SIZE                   104
  459. #define SQL_MAXIMUM_ROW_SIZE               SQL_MAX_ROW_SIZE
  460. #define SQL_MAX_STATEMENT_LEN              105
  461. #define SQL_MAXIMUM_STATEMENT_LENGTH       SQL_MAX_STATEMENT_LEN
  462. #define SQL_MAX_TABLES_IN_SELECT           106
  463. #define SQL_MAXIMUM_TABLES_IN_SELECT       SQL_MAX_TABLES_IN_SELECT
  464. #define SQL_MAX_USER_NAME_LEN              107
  465. #define SQL_MAXIMUM_USER_NAME_LENGTH       SQL_MAX_USER_NAME_LEN
  466. #if (ODBCVER >= 0x0300)
  467. #define SQL_OJ_CAPABILITIES                115
  468. #define SQL_OUTER_JOIN_CAPABILITIES           SQL_OJ_CAPABILITIES
  469. #endif /* ODBCVER >= 0x0300 */
  470.  
  471. #if (ODBCVER >= 0x0300)
  472. #define SQL_XOPEN_CLI_YEAR               10000
  473. #define SQL_CURSOR_SENSITIVITY           10001
  474. #define SQL_DESCRIBE_PARAMETER           10002
  475. #define SQL_CATALOG_NAME                 10003
  476. #define SQL_COLLATION_SEQ                10004
  477. #define SQL_MAX_IDENTIFIER_LEN           10005
  478. #define SQL_MAXIMUM_IDENTIFIER_LENGTH     SQL_MAX_IDENTIFIER_LEN
  479. #endif /* ODBCVER >= 0x0300 */
  480.  
  481. /* SQL_ALTER_TABLE bitmasks */
  482. #if (ODBCVER >= 0x0200)
  483. #define SQL_AT_ADD_COLUMN                       0x00000001L
  484. #define SQL_AT_DROP_COLUMN                      0x00000002L
  485. #endif /* ODBCVER >= 0x0200 */
  486.  
  487. #if (ODBCVER >= 0x0300)
  488. #define SQL_AT_ADD_CONSTRAINT                   0x00000008L
  489.  
  490. /* The following bitmasks are ODBC extensions and defined in sqlext.h
  491. *#define    SQL_AT_COLUMN_SINGLE                    0x00000020L    
  492. *#define    SQL_AT_ADD_COLUMN_DEFAULT                0x00000040L
  493. *#define    SQL_AT_ADD_COLUMN_COLLATION                0x00000080L
  494. *#define    SQL_AT_SET_COLUMN_DEFAULT                0x00000100L
  495. *#define    SQL_AT_DROP_COLUMN_DEFAULT                0x00000200L
  496. *#define    SQL_AT_DROP_COLUMN_CASCADE                0x00000400L
  497. *#define    SQL_AT_DROP_COLUMN_RESTRICT                0x00000800L
  498. *#define SQL_AT_ADD_TABLE_CONSTRAINT                0x00001000L        
  499. *#define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE        0x00002000L        
  500. *#define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT        0x00004000L        
  501. *#define SQL_AT_CONSTRAINT_NAME_DEFINITION            0x00008000L
  502. *#define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED        0x00010000L
  503. *#define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE        0x00020000L
  504. *#define SQL_AT_CONSTRAINT_DEFERRABLE                0x00040000L
  505. *#define SQL_AT_CONSTRAINT_NON_DEFERRABLE            0x00080000L
  506. */
  507. #endif  /* ODBCVER >= 0x0300 */
  508.  
  509.  
  510. /* SQL_ASYNC_MODE values */
  511. #if (ODBCVER >= 0x0300)
  512. #define SQL_AM_NONE                         0
  513. #define SQL_AM_CONNECTION                   1
  514. #define SQL_AM_STATEMENT                    2
  515. #endif
  516.  
  517. /* SQL_CURSOR_COMMIT_BEHAVIOR values */
  518. #define SQL_CB_DELETE                       0
  519. #define SQL_CB_CLOSE                        1
  520. #define SQL_CB_PRESERVE                     2
  521.  
  522. /* SQL_FETCH_DIRECTION bitmasks */
  523. #define SQL_FD_FETCH_NEXT                   0x00000001L
  524. #define SQL_FD_FETCH_FIRST                  0x00000002L
  525. #define SQL_FD_FETCH_LAST                   0x00000004L
  526. #define SQL_FD_FETCH_PRIOR                  0x00000008L
  527. #define SQL_FD_FETCH_ABSOLUTE               0x00000010L
  528. #define SQL_FD_FETCH_RELATIVE               0x00000020L
  529.  
  530. /* SQL_GETDATA_EXTENSIONS bitmasks */
  531. #define SQL_GD_ANY_COLUMN                   0x00000001L
  532. #define SQL_GD_ANY_ORDER                    0x00000002L
  533.  
  534. /* SQL_IDENTIFIER_CASE values */
  535. #define SQL_IC_UPPER                        1
  536. #define SQL_IC_LOWER                        2
  537. #define SQL_IC_SENSITIVE                    3
  538. #define SQL_IC_MIXED                        4
  539.  
  540. /* SQL_OJ_CAPABILITIES bitmasks */
  541. /* NB: this means 'outer join', not what  you may be thinking */
  542.  
  543.  
  544. #if (ODBCVER >= 0x0201)
  545. #define SQL_OJ_LEFT                         0x00000001L
  546. #define SQL_OJ_RIGHT                        0x00000002L
  547. #define SQL_OJ_FULL                         0x00000004L
  548. #define SQL_OJ_NESTED                       0x00000008L
  549. #define SQL_OJ_NOT_ORDERED                  0x00000010L
  550. #define SQL_OJ_INNER                        0x00000020L
  551. #define SQL_OJ_ALL_COMPARISON_OPS           0x00000040L
  552. #endif
  553.  
  554. /* SQL_SCROLL_CONCURRENCY bitmasks */
  555. #define SQL_SCCO_READ_ONLY                  0x00000001L
  556. #define SQL_SCCO_LOCK                       0x00000002L
  557. #define SQL_SCCO_OPT_ROWVER                 0x00000004L
  558. #define SQL_SCCO_OPT_VALUES                 0x00000008L
  559.  
  560. /* SQL_TXN_CAPABLE values */
  561. #define SQL_TC_NONE                         0
  562. #define SQL_TC_DML                          1
  563. #define SQL_TC_ALL                          2
  564. #define SQL_TC_DDL_COMMIT                   3
  565. #define SQL_TC_DDL_IGNORE                   4
  566.  
  567. /* SQL_TXN_ISOLATION_OPTION bitmasks */
  568. #define SQL_TXN_READ_UNCOMMITTED            0x00000001L
  569. #define SQL_TRANSACTION_READ_UNCOMMITTED    SQL_TXN_READ_UNCOMMITTED
  570. #define SQL_TXN_READ_COMMITTED              0x00000002L
  571. #define SQL_TRANSACTION_READ_COMMITTED        SQL_TXN_READ_COMMITTED
  572. #define SQL_TXN_REPEATABLE_READ             0x00000004L
  573. #define SQL_TRANSACTION_REPEATABLE_READ        SQL_TXN_REPEATABLE_READ
  574. #define SQL_TXN_SERIALIZABLE                0x00000008L
  575. #define SQL_TRANSACTION_SERIALIZABLE        SQL_TXN_SERIALIZABLE
  576.  
  577. /* SQL_NULL_COLLATION values */
  578. #define SQL_NC_HIGH                         0
  579. #define SQL_NC_LOW                          1
  580.  
  581. #ifndef RC_INVOKED
  582.  
  583. SQLRETURN  SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle,
  584.            SQLHDBC *ConnectionHandle);
  585.  
  586. SQLRETURN  SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle);
  587.  
  588. #if (ODBCVER >= 0x0300)
  589. SQLRETURN  SQL_API SQLAllocHandle(SQLSMALLINT HandleType,
  590.            SQLHANDLE InputHandle, SQLHANDLE *OutputHandle);
  591. #endif
  592.  
  593. SQLRETURN  SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle,
  594.            SQLHSTMT *StatementHandle);
  595.  
  596. SQLRETURN  SQL_API SQLBindCol(SQLHSTMT StatementHandle, 
  597.            SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, 
  598.            SQLPOINTER TargetValue, SQLINTEGER BufferLength, 
  599.               SQLINTEGER *StrLen_or_Ind);
  600.  
  601. #if (ODBCVER >= 0x0300)
  602. SQLRETURN  SQL_API SQLBindParam(SQLHSTMT StatementHandle,
  603.            SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
  604.            SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
  605.            SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
  606.            SQLINTEGER *StrLen_or_Ind);
  607. #endif
  608.  
  609. SQLRETURN  SQL_API SQLCancel(SQLHSTMT StatementHandle);
  610.  
  611. #if (ODBCVER >= 0x0300)
  612. SQLRETURN  SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);
  613.  
  614. SQLRETURN  SQL_API SQLColAttribute (SQLHSTMT StatementHandle,
  615.            SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
  616.            SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
  617.            SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute);
  618. #endif
  619.  
  620.  
  621. SQLRETURN  SQL_API SQLColumns(SQLHSTMT StatementHandle,
  622.            SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
  623.            SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
  624.            SQLCHAR *TableName, SQLSMALLINT NameLength3,
  625.            SQLCHAR *ColumnName, SQLSMALLINT NameLength4);
  626.  
  627.  
  628. SQLRETURN  SQL_API SQLConnect(SQLHDBC ConnectionHandle,
  629.            SQLCHAR *ServerName, SQLSMALLINT NameLength1,
  630.            SQLCHAR *UserName, SQLSMALLINT NameLength2,
  631.            SQLCHAR *Authentication, SQLSMALLINT NameLength3);
  632.  
  633. #if (ODBCVER >= 0x0300)
  634. SQLRETURN  SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle,
  635.            SQLHDESC TargetDescHandle);
  636. #endif
  637.  
  638. SQLRETURN  SQL_API SQLDataSources(SQLHENV EnvironmentHandle,
  639.            SQLUSMALLINT Direction, SQLCHAR *ServerName,
  640.            SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
  641.            SQLCHAR *Description, SQLSMALLINT BufferLength2,
  642.            SQLSMALLINT *NameLength2);
  643.  
  644. SQLRETURN  SQL_API SQLDescribeCol(SQLHSTMT StatementHandle,
  645.            SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
  646.            SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
  647.            SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize,
  648.            SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable);
  649.  
  650. SQLRETURN  SQL_API SQLDisconnect(SQLHDBC ConnectionHandle);
  651.  
  652. #if (ODBCVER >= 0x0300)
  653. SQLRETURN  SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle,
  654.            SQLSMALLINT CompletionType);
  655. #endif
  656.  
  657. SQLRETURN  SQL_API SQLError(SQLHENV EnvironmentHandle,
  658.            SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
  659.            SQLCHAR *Sqlstate, SQLINTEGER *NativeError,
  660.            SQLCHAR *MessageText, SQLSMALLINT BufferLength,
  661.            SQLSMALLINT *TextLength);
  662.  
  663. SQLRETURN  SQL_API SQLExecDirect(SQLHSTMT StatementHandle,
  664.            SQLCHAR *StatementText, SQLINTEGER TextLength);
  665.  
  666. SQLRETURN  SQL_API SQLExecute(SQLHSTMT StatementHandle);
  667.  
  668. SQLRETURN  SQL_API SQLFetch(SQLHSTMT StatementHandle);
  669.  
  670. #if (ODBCVER >= 0x0300)
  671. SQLRETURN  SQL_API SQLFetchScroll(SQLHSTMT StatementHandle,
  672.            SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset);
  673. #endif
  674.  
  675. SQLRETURN  SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle);
  676.  
  677. SQLRETURN  SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle);
  678.  
  679. #if (ODBCVER >= 0x0300)
  680. SQLRETURN  SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle);
  681. #endif
  682.  
  683. SQLRETURN  SQL_API SQLFreeStmt(SQLHSTMT StatementHandle,
  684.            SQLUSMALLINT Option);
  685.  
  686. #if (ODBCVER >= 0x0300)
  687. SQLRETURN  SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle,
  688.            SQLINTEGER Attribute, SQLPOINTER Value,
  689.            SQLINTEGER BufferLength, SQLINTEGER *StringLength);
  690. #endif
  691.  
  692. SQLRETURN  SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle,
  693.            SQLUSMALLINT Option, SQLPOINTER Value);
  694.  
  695. SQLRETURN  SQL_API SQLGetCursorName(SQLHSTMT StatementHandle,
  696.            SQLCHAR *CursorName, SQLSMALLINT BufferLength,
  697.            SQLSMALLINT *NameLength);
  698.  
  699. SQLRETURN  SQL_API SQLGetData(SQLHSTMT StatementHandle,
  700.            SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
  701.            SQLPOINTER TargetValue, SQLINTEGER BufferLength,
  702.            SQLINTEGER *StrLen_or_Ind);
  703.  
  704. #if (ODBCVER >= 0x0300)
  705. SQLRETURN  SQL_API SQLGetDescField(SQLHDESC DescriptorHandle,
  706.            SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
  707.            SQLPOINTER Value, SQLINTEGER BufferLength,
  708.            SQLINTEGER *StringLength);
  709.  
  710. SQLRETURN  SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle,
  711.            SQLSMALLINT RecNumber, SQLCHAR *Name,
  712.            SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
  713.            SQLSMALLINT *Type, SQLSMALLINT *SubType, 
  714.            SQLINTEGER *Length, SQLSMALLINT *Precision, 
  715.            SQLSMALLINT *Scale, SQLSMALLINT *Nullable);
  716.  
  717. SQLRETURN  SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle,
  718.            SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
  719.            SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
  720.            SQLSMALLINT *StringLength);
  721.  
  722. SQLRETURN  SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
  723.            SQLSMALLINT RecNumber, SQLCHAR *Sqlstate,
  724.            SQLINTEGER *NativeError, SQLCHAR *MessageText,
  725.            SQLSMALLINT BufferLength, SQLSMALLINT *TextLength);
  726.  
  727. SQLRETURN  SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle,
  728.            SQLINTEGER Attribute, SQLPOINTER Value,
  729.            SQLINTEGER BufferLength, SQLINTEGER *StringLength);
  730. #endif  /* ODBCVER >= 0x0300 */
  731.  
  732. SQLRETURN  SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle,
  733.            SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported);
  734.  
  735. SQLRETURN  SQL_API SQLGetInfo(SQLHDBC ConnectionHandle,
  736.            SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
  737.            SQLSMALLINT BufferLength, SQLSMALLINT *StringLength);
  738.  
  739. #if (ODBCVER >= 0x0300)
  740. SQLRETURN  SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle,
  741.            SQLINTEGER Attribute, SQLPOINTER Value,
  742.            SQLINTEGER BufferLength, SQLINTEGER *StringLength);
  743. #endif  /* ODBCVER >= 0x0300 */
  744.  
  745. SQLRETURN  SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle,
  746.            SQLUSMALLINT Option, SQLPOINTER Value);
  747.  
  748. SQLRETURN  SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle,
  749.            SQLSMALLINT DataType);
  750.  
  751. SQLRETURN  SQL_API SQLNumResultCols(SQLHSTMT StatementHandle,
  752.            SQLSMALLINT *ColumnCount);
  753.  
  754. SQLRETURN  SQL_API SQLParamData(SQLHSTMT StatementHandle,
  755.            SQLPOINTER *Value);
  756.  
  757. SQLRETURN  SQL_API SQLPrepare(SQLHSTMT StatementHandle,
  758.            SQLCHAR *StatementText, SQLINTEGER TextLength);
  759.  
  760. SQLRETURN  SQL_API SQLPutData(SQLHSTMT StatementHandle,
  761.            SQLPOINTER Data, SQLINTEGER StrLen_or_Ind);
  762.  
  763. SQLRETURN  SQL_API SQLRowCount(SQLHSTMT StatementHandle, 
  764.        SQLINTEGER *RowCount);
  765.  
  766. #if (ODBCVER >= 0x0300)
  767. SQLRETURN  SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle,
  768.            SQLINTEGER Attribute, SQLPOINTER Value,
  769.            SQLINTEGER StringLength);
  770. #endif /* ODBCVER >= 0x0300 */
  771.  
  772. SQLRETURN  SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle,
  773.            SQLUSMALLINT Option, SQLUINTEGER Value);
  774.  
  775. SQLRETURN  SQL_API SQLSetCursorName(SQLHSTMT StatementHandle,
  776.            SQLCHAR *CursorName, SQLSMALLINT NameLength);
  777.  
  778. #if (ODBCVER >= 0x0300)
  779. SQLRETURN  SQL_API SQLSetDescField(SQLHDESC DescriptorHandle,
  780.            SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
  781.            SQLPOINTER Value, SQLINTEGER BufferLength);
  782.  
  783. SQLRETURN  SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle,
  784.            SQLSMALLINT RecNumber, SQLSMALLINT Type,
  785.            SQLSMALLINT SubType, SQLINTEGER Length,
  786.            SQLSMALLINT Precision, SQLSMALLINT Scale,
  787.            SQLPOINTER Data, SQLINTEGER *StringLength,
  788.            SQLINTEGER *Indicator);
  789.  
  790. SQLRETURN  SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle,
  791.            SQLINTEGER Attribute, SQLPOINTER Value,
  792.            SQLINTEGER StringLength);
  793. #endif /* ODBCVER >= 0x0300 */
  794.  
  795. SQLRETURN  SQL_API SQLSetParam(SQLHSTMT StatementHandle,
  796.            SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
  797.            SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
  798.            SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
  799.            SQLINTEGER *StrLen_or_Ind);
  800.  
  801. #if (ODBCVER >= 0x0300)
  802. SQLRETURN  SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle,
  803.            SQLINTEGER Attribute, SQLPOINTER Value,
  804.            SQLINTEGER StringLength);
  805. #endif
  806.  
  807. SQLRETURN  SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle,
  808.            SQLUSMALLINT Option, SQLUINTEGER Value);
  809.  
  810. SQLRETURN  SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle,
  811.            SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
  812.            SQLSMALLINT NameLength1, SQLCHAR *SchemaName,
  813.            SQLSMALLINT NameLength2, SQLCHAR *TableName,
  814.            SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
  815.            SQLUSMALLINT Nullable);
  816.  
  817. SQLRETURN  SQL_API SQLStatistics(SQLHSTMT StatementHandle,
  818.            SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
  819.            SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
  820.            SQLCHAR *TableName, SQLSMALLINT NameLength3,
  821.            SQLUSMALLINT Unique, SQLUSMALLINT Reserved);
  822.  
  823. SQLRETURN  SQL_API SQLTables(SQLHSTMT StatementHandle,
  824.            SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
  825.            SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
  826.            SQLCHAR *TableName, SQLSMALLINT NameLength3,
  827.            SQLCHAR *TableType, SQLSMALLINT NameLength4);
  828.  
  829. SQLRETURN  SQL_API SQLTransact(SQLHENV EnvironmentHandle,
  830.            SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);
  831.  
  832. #endif  /* RC_INVOKED */
  833.  
  834. #ifdef __cplusplus
  835. }                                    /* End of extern "C" { */
  836. #endif  /* __cplusplus */
  837. #endif    /* #ifndef __SQL */
  838.