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