Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2104 lines
76 KiB

  1. #include "windows.h"
  2. #ifndef __SQL
  3. #include "sql.h"
  4. #endif
  5. #ifdef __cplusplus
  6. extern "C" { /* Assume C declarations for C++ */
  7. #endif /* __cplusplus */
  8. /* generally useful constants */
  9. #define SQL_SPEC_MAJOR 3 /* Major version of specification */
  10. #define SQL_SPEC_MINOR 52 /* Minor version of specification */
  11. #define SQL_SPEC_STRING "03.52" /* String constant for version */
  12. #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */
  13. #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */
  14. #define SQL_MAX_OPTION_STRING_LENGTH 256
  15. /* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */
  16. #if (ODBCVER < 0x0300)
  17. #define SQL_NO_DATA_FOUND 100
  18. #else
  19. #define SQL_NO_DATA_FOUND SQL_NO_DATA
  20. #endif
  21. /* an end handle type */
  22. #if (ODBCVER >= 0x0300)
  23. #define SQL_HANDLE_SENV 5
  24. #endif /* ODBCVER >= 0x0300 */
  25. /* env attribute */
  26. #if (ODBCVER >= 0x0300)
  27. #define SQL_ATTR_ODBC_VERSION 200
  28. #define SQL_ATTR_CONNECTION_POOLING 201
  29. #define SQL_ATTR_CP_MATCH 202
  30. #endif /* ODBCVER >= 0x0300 */
  31. #if (ODBCVER >= 0x0300)
  32. /* values for SQL_ATTR_CONNECTION_POOLING */
  33. #define SQL_CP_OFF 0UL
  34. #define SQL_CP_ONE_PER_DRIVER 1UL
  35. #define SQL_CP_ONE_PER_HENV 2UL
  36. #define SQL_CP_DEFAULT SQL_CP_OFF
  37. /* values for SQL_ATTR_CP_MATCH */
  38. #define SQL_CP_STRICT_MATCH 0UL
  39. #define SQL_CP_RELAXED_MATCH 1UL
  40. #define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH
  41. /* values for SQL_ATTR_ODBC_VERSION */
  42. #define SQL_OV_ODBC2 2UL
  43. #define SQL_OV_ODBC3 3UL
  44. #endif /* ODBCVER >= 0x0300 */
  45. /* connection attributes */
  46. #define SQL_ACCESS_MODE 101
  47. #define SQL_AUTOCOMMIT 102
  48. #define SQL_LOGIN_TIMEOUT 103
  49. #define SQL_OPT_TRACE 104
  50. #define SQL_OPT_TRACEFILE 105
  51. #define SQL_TRANSLATE_DLL 106
  52. #define SQL_TRANSLATE_OPTION 107
  53. #define SQL_TXN_ISOLATION 108
  54. #define SQL_CURRENT_QUALIFIER 109
  55. #define SQL_ODBC_CURSORS 110
  56. #define SQL_QUIET_MODE 111
  57. #define SQL_PACKET_SIZE 112
  58. /* connection attributes with new names */
  59. #if (ODBCVER >= 0x0300)
  60. #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
  61. #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
  62. #define SQL_ATTR_CONNECTION_TIMEOUT 113
  63. #define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
  64. #define SQL_ATTR_DISCONNECT_BEHAVIOR 114
  65. #define SQL_ATTR_ENLIST_IN_DTC 1207
  66. #define SQL_ATTR_ENLIST_IN_XA 1208
  67. #define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
  68. #define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
  69. #define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
  70. #define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
  71. #define SQL_ATTR_TRACE SQL_OPT_TRACE
  72. #define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
  73. #define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
  74. #define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
  75. #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
  76. #endif /* ODBCVER >= 0x0300 */
  77. #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */
  78. #if (ODBCVER >= 0x0351)
  79. /* ODBC Driver Manager sets this connection attribute to a unicode driver
  80. (which supports SQLConnectW) when the application is an ANSI application
  81. (which calls SQLConnect, SQLDriverConnect, or SQLBrowseConnect).
  82. This is SetConnectAttr only and application does not set this attribute
  83. This attribute was introduced because some unicode driver's some APIs may
  84. need to behave differently on ANSI or Unicode applications. A unicode
  85. driver, which has same behavior for both ANSI or Unicode applications,
  86. should return SQL_ERROR when the driver manager sets this connection
  87. attribute. When a unicode driver returns SQL_SUCCESS on this attribute,
  88. the driver manager treates ANSI and Unicode connections differently in
  89. connection pooling.
  90. */
  91. #define SQL_ATTR_ANSI_APP 115
  92. #endif
  93. /* SQL_CONNECT_OPT_DRVR_START is not meaningful for 3.0 driver */
  94. #if (ODBCVER < 0x0300)
  95. #define SQL_CONNECT_OPT_DRVR_START 1000
  96. #endif /* ODBCVER < 0x0300 */
  97. #if (ODBCVER < 0x0300)
  98. #define SQL_CONN_OPT_MAX SQL_PACKET_SIZE
  99. #define SQL_CONN_OPT_MIN SQL_ACCESS_MODE
  100. #endif /* ODBCVER < 0x0300 */
  101. /* SQL_ACCESS_MODE options */
  102. #define SQL_MODE_READ_WRITE 0UL
  103. #define SQL_MODE_READ_ONLY 1UL
  104. #define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE
  105. /* SQL_AUTOCOMMIT options */
  106. #define SQL_AUTOCOMMIT_OFF 0UL
  107. #define SQL_AUTOCOMMIT_ON 1UL
  108. #define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON
  109. /* SQL_LOGIN_TIMEOUT options */
  110. #define SQL_LOGIN_TIMEOUT_DEFAULT 15UL
  111. /* SQL_OPT_TRACE options */
  112. #define SQL_OPT_TRACE_OFF 0UL
  113. #define SQL_OPT_TRACE_ON 1UL
  114. #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF
  115. #define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG"
  116. /* SQL_ODBC_CURSORS options */
  117. #define SQL_CUR_USE_IF_NEEDED 0UL
  118. #define SQL_CUR_USE_ODBC 1UL
  119. #define SQL_CUR_USE_DRIVER 2UL
  120. #define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER
  121. #if (ODBCVER >= 0x0300)
  122. /* values for SQL_ATTR_DISCONNECT_BEHAVIOR */
  123. #define SQL_DB_RETURN_TO_POOL 0UL
  124. #define SQL_DB_DISCONNECT 1UL
  125. #define SQL_DB_DEFAULT SQL_DB_RETURN_TO_POOL
  126. /* values for SQL_ATTR_ENLIST_IN_DTC */
  127. #define SQL_DTC_DONE 0L
  128. #endif /* ODBCVER >= 0x0300 */
  129. /* values for SQL_ATTR_CONNECTION_DEAD */
  130. #define SQL_CD_TRUE 1L /* Connection is closed/dead */
  131. #define SQL_CD_FALSE 0L /* Connection is open/available */
  132. /* values for SQL_ATTR_ANSI_APP */
  133. #if (ODBCVER >= 0x0351)
  134. #define SQL_AA_TRUE 1L /* the application is an ANSI app */
  135. #define SQL_AA_FALSE 0L /* the application is a Unicode app */
  136. #endif
  137. /* statement attributes */
  138. #define SQL_QUERY_TIMEOUT 0
  139. #define SQL_MAX_ROWS 1
  140. #define SQL_NOSCAN 2
  141. #define SQL_MAX_LENGTH 3
  142. #define SQL_ASYNC_ENABLE 4 /* same as SQL_ATTR_ASYNC_ENABLE */
  143. #define SQL_BIND_TYPE 5
  144. #define SQL_CURSOR_TYPE 6
  145. #define SQL_CONCURRENCY 7
  146. #define SQL_KEYSET_SIZE 8
  147. #define SQL_ROWSET_SIZE 9
  148. #define SQL_SIMULATE_CURSOR 10
  149. #define SQL_RETRIEVE_DATA 11
  150. #define SQL_USE_BOOKMARKS 12
  151. #define SQL_GET_BOOKMARK 13 /* GetStmtOption Only */
  152. #define SQL_ROW_NUMBER 14 /* GetStmtOption Only */
  153. /* statement attributes for ODBC 3.0 */
  154. #if (ODBCVER >= 0x0300)
  155. #define SQL_ATTR_ASYNC_ENABLE 4
  156. #define SQL_ATTR_CONCURRENCY SQL_CONCURRENCY
  157. #define SQL_ATTR_CURSOR_TYPE SQL_CURSOR_TYPE
  158. #define SQL_ATTR_ENABLE_AUTO_IPD 15
  159. #define SQL_ATTR_FETCH_BOOKMARK_PTR 16
  160. #define SQL_ATTR_KEYSET_SIZE SQL_KEYSET_SIZE
  161. #define SQL_ATTR_MAX_LENGTH SQL_MAX_LENGTH
  162. #define SQL_ATTR_MAX_ROWS SQL_MAX_ROWS
  163. #define SQL_ATTR_NOSCAN SQL_NOSCAN
  164. #define SQL_ATTR_PARAM_BIND_OFFSET_PTR 17
  165. #define SQL_ATTR_PARAM_BIND_TYPE 18
  166. #define SQL_ATTR_PARAM_OPERATION_PTR 19
  167. #define SQL_ATTR_PARAM_STATUS_PTR 20
  168. #define SQL_ATTR_PARAMS_PROCESSED_PTR 21
  169. #define SQL_ATTR_PARAMSET_SIZE 22
  170. #define SQL_ATTR_QUERY_TIMEOUT SQL_QUERY_TIMEOUT
  171. #define SQL_ATTR_RETRIEVE_DATA SQL_RETRIEVE_DATA
  172. #define SQL_ATTR_ROW_BIND_OFFSET_PTR 23
  173. #define SQL_ATTR_ROW_BIND_TYPE SQL_BIND_TYPE
  174. #define SQL_ATTR_ROW_NUMBER SQL_ROW_NUMBER /*GetStmtAttr*/
  175. #define SQL_ATTR_ROW_OPERATION_PTR 24
  176. #define SQL_ATTR_ROW_STATUS_PTR 25
  177. #define SQL_ATTR_ROWS_FETCHED_PTR 26
  178. #define SQL_ATTR_ROW_ARRAY_SIZE 27
  179. #define SQL_ATTR_SIMULATE_CURSOR SQL_SIMULATE_CURSOR
  180. #define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS
  181. #endif /* ODBCVER >= 0x0300 */
  182. #if (ODBCVER < 0x0300)
  183. #define SQL_STMT_OPT_MAX SQL_ROW_NUMBER
  184. #define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT
  185. #endif /* ODBCVER < 0x0300 */
  186. /* New defines for SEARCHABLE column in SQLGetTypeInfo */
  187. #if (ODBCVER >= 0x0300)
  188. #define SQL_COL_PRED_CHAR SQL_LIKE_ONLY
  189. #define SQL_COL_PRED_BASIC SQL_ALL_EXCEPT_LIKE
  190. #endif /* ODBCVER >= 0x0300 */
  191. /* whether an attribute is a pointer or not */
  192. #if (ODBCVER >= 0x0300)
  193. #define SQL_IS_POINTER (-4)
  194. #define SQL_IS_UINTEGER (-5)
  195. #define SQL_IS_INTEGER (-6)
  196. #define SQL_IS_USMALLINT (-7)
  197. #define SQL_IS_SMALLINT (-8)
  198. #endif /* ODBCVER >= 0x0300 */
  199. /* the value of SQL_ATTR_PARAM_BIND_TYPE */
  200. #if (ODBCVER >= 0x0300)
  201. #define SQL_PARAM_BIND_BY_COLUMN 0UL
  202. #define SQL_PARAM_BIND_TYPE_DEFAULT SQL_PARAM_BIND_BY_COLUMN
  203. #endif /* ODBCVER >= 0x0300 */
  204. /* SQL_QUERY_TIMEOUT options */
  205. #define SQL_QUERY_TIMEOUT_DEFAULT 0UL
  206. /* SQL_MAX_ROWS options */
  207. #define SQL_MAX_ROWS_DEFAULT 0UL
  208. /* SQL_NOSCAN options */
  209. #define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */
  210. #define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */
  211. #define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF
  212. /* SQL_MAX_LENGTH options */
  213. #define SQL_MAX_LENGTH_DEFAULT 0UL
  214. /* values for SQL_ATTR_ASYNC_ENABLE */
  215. #define SQL_ASYNC_ENABLE_OFF 0UL
  216. #define SQL_ASYNC_ENABLE_ON 1UL
  217. #define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF
  218. /* SQL_BIND_TYPE options */
  219. #define SQL_BIND_BY_COLUMN 0UL
  220. #define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN /* Default value */
  221. /* SQL_CONCURRENCY options */
  222. #define SQL_CONCUR_READ_ONLY 1
  223. #define SQL_CONCUR_LOCK 2
  224. #define SQL_CONCUR_ROWVER 3
  225. #define SQL_CONCUR_VALUES 4
  226. #define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY /* Default value */
  227. /* SQL_CURSOR_TYPE options */
  228. #define SQL_CURSOR_FORWARD_ONLY 0UL
  229. #define SQL_CURSOR_KEYSET_DRIVEN 1UL
  230. #define SQL_CURSOR_DYNAMIC 2UL
  231. #define SQL_CURSOR_STATIC 3UL
  232. #define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY /* Default value */
  233. /* SQL_ROWSET_SIZE options */
  234. #define SQL_ROWSET_SIZE_DEFAULT 1UL
  235. /* SQL_KEYSET_SIZE options */
  236. #define SQL_KEYSET_SIZE_DEFAULT 0UL
  237. /* SQL_SIMULATE_CURSOR options */
  238. #define SQL_SC_NON_UNIQUE 0UL
  239. #define SQL_SC_TRY_UNIQUE 1UL
  240. #define SQL_SC_UNIQUE 2UL
  241. /* SQL_RETRIEVE_DATA options */
  242. #define SQL_RD_OFF 0UL
  243. #define SQL_RD_ON 1UL
  244. #define SQL_RD_DEFAULT SQL_RD_ON
  245. /* SQL_USE_BOOKMARKS options */
  246. #define SQL_UB_OFF 0UL
  247. #define SQL_UB_ON 01UL
  248. #define SQL_UB_DEFAULT SQL_UB_OFF
  249. /* New values for SQL_USE_BOOKMARKS attribute */
  250. #if (ODBCVER >= 0x0300)
  251. #define SQL_UB_FIXED SQL_UB_ON
  252. #define SQL_UB_VARIABLE 2UL
  253. #endif /* ODBCVER >= 0x0300 */
  254. /* extended descriptor field */
  255. #if (ODBCVER >= 0x0300)
  256. #define SQL_DESC_ARRAY_SIZE 20
  257. #define SQL_DESC_ARRAY_STATUS_PTR 21
  258. #define SQL_DESC_AUTO_UNIQUE_VALUE SQL_COLUMN_AUTO_INCREMENT
  259. #define SQL_DESC_BASE_COLUMN_NAME 22
  260. #define SQL_DESC_BASE_TABLE_NAME 23
  261. #define SQL_DESC_BIND_OFFSET_PTR 24
  262. #define SQL_DESC_BIND_TYPE 25
  263. #define SQL_DESC_CASE_SENSITIVE SQL_COLUMN_CASE_SENSITIVE
  264. #define SQL_DESC_CATALOG_NAME SQL_COLUMN_QUALIFIER_NAME
  265. #define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE
  266. #define SQL_DESC_DATETIME_INTERVAL_PRECISION 26
  267. #define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE
  268. #define SQL_DESC_FIXED_PREC_SCALE SQL_COLUMN_MONEY
  269. #define SQL_DESC_LABEL SQL_COLUMN_LABEL
  270. #define SQL_DESC_LITERAL_PREFIX 27
  271. #define SQL_DESC_LITERAL_SUFFIX 28
  272. #define SQL_DESC_LOCAL_TYPE_NAME 29
  273. #define SQL_DESC_MAXIMUM_SCALE 30
  274. #define SQL_DESC_MINIMUM_SCALE 31
  275. #define SQL_DESC_NUM_PREC_RADIX 32
  276. #define SQL_DESC_PARAMETER_TYPE 33
  277. #define SQL_DESC_ROWS_PROCESSED_PTR 34
  278. #if (ODBCVER >= 0x0350)
  279. #define SQL_DESC_ROWVER 35
  280. #endif /* ODBCVER >= 0x0350 */
  281. #define SQL_DESC_SCHEMA_NAME SQL_COLUMN_OWNER_NAME
  282. #define SQL_DESC_SEARCHABLE SQL_COLUMN_SEARCHABLE
  283. #define SQL_DESC_TYPE_NAME SQL_COLUMN_TYPE_NAME
  284. #define SQL_DESC_TABLE_NAME SQL_COLUMN_TABLE_NAME
  285. #define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED
  286. #define SQL_DESC_UPDATABLE SQL_COLUMN_UPDATABLE
  287. #endif /* ODBCVER >= 0x0300 */
  288. /* defines for diagnostics fields */
  289. #if (ODBCVER >= 0x0300)
  290. #define SQL_DIAG_CURSOR_ROW_COUNT (-1249)
  291. #define SQL_DIAG_ROW_NUMBER (-1248)
  292. #define SQL_DIAG_COLUMN_NUMBER (-1247)
  293. #endif /* ODBCVER >= 0x0300 */
  294. /* SQL extended datatypes */
  295. #define SQL_DATE 9
  296. #if (ODBCVER >= 0x0300)
  297. #define SQL_INTERVAL 10
  298. #endif /* ODBCVER >= 0x0300 */
  299. #define SQL_TIME 10
  300. #define SQL_TIMESTAMP 11
  301. #define SQL_LONGVARCHAR (-1)
  302. #define SQL_BINARY (-2)
  303. #define SQL_VARBINARY (-3)
  304. #define SQL_LONGVARBINARY (-4)
  305. #define SQL_BIGINT (-5)
  306. #define SQL_TINYINT (-6)
  307. #define SQL_BIT (-7)
  308. #if (ODBCVER >= 0x0350)
  309. #define SQL_GUID (-11)
  310. #endif /* ODBCVER >= 0x0350 */
  311. #if (ODBCVER >= 0x0300)
  312. /* interval code */
  313. #define SQL_CODE_YEAR 1
  314. #define SQL_CODE_MONTH 2
  315. #define SQL_CODE_DAY 3
  316. #define SQL_CODE_HOUR 4
  317. #define SQL_CODE_MINUTE 5
  318. #define SQL_CODE_SECOND 6
  319. #define SQL_CODE_YEAR_TO_MONTH 7
  320. #define SQL_CODE_DAY_TO_HOUR 8
  321. #define SQL_CODE_DAY_TO_MINUTE 9
  322. #define SQL_CODE_DAY_TO_SECOND 10
  323. #define SQL_CODE_HOUR_TO_MINUTE 11
  324. #define SQL_CODE_HOUR_TO_SECOND 12
  325. #define SQL_CODE_MINUTE_TO_SECOND 13
  326. #define SQL_INTERVAL_YEAR (100 + SQL_CODE_YEAR)
  327. #define SQL_INTERVAL_MONTH (100 + SQL_CODE_MONTH)
  328. #define SQL_INTERVAL_DAY (100 + SQL_CODE_DAY)
  329. #define SQL_INTERVAL_HOUR (100 + SQL_CODE_HOUR)
  330. #define SQL_INTERVAL_MINUTE (100 + SQL_CODE_MINUTE)
  331. #define SQL_INTERVAL_SECOND (100 + SQL_CODE_SECOND)
  332. #define SQL_INTERVAL_YEAR_TO_MONTH (100 + SQL_CODE_YEAR_TO_MONTH)
  333. #define SQL_INTERVAL_DAY_TO_HOUR (100 + SQL_CODE_DAY_TO_HOUR)
  334. #define SQL_INTERVAL_DAY_TO_MINUTE (100 + SQL_CODE_DAY_TO_MINUTE)
  335. #define SQL_INTERVAL_DAY_TO_SECOND (100 + SQL_CODE_DAY_TO_SECOND)
  336. #define SQL_INTERVAL_HOUR_TO_MINUTE (100 + SQL_CODE_HOUR_TO_MINUTE)
  337. #define SQL_INTERVAL_HOUR_TO_SECOND (100 + SQL_CODE_HOUR_TO_SECOND)
  338. #define SQL_INTERVAL_MINUTE_TO_SECOND (100 + SQL_CODE_MINUTE_TO_SECOND)
  339. #else
  340. #define SQL_INTERVAL_YEAR (-80)
  341. #define SQL_INTERVAL_MONTH (-81)
  342. #define SQL_INTERVAL_YEAR_TO_MONTH (-82)
  343. #define SQL_INTERVAL_DAY (-83)
  344. #define SQL_INTERVAL_HOUR (-84)
  345. #define SQL_INTERVAL_MINUTE (-85)
  346. #define SQL_INTERVAL_SECOND (-86)
  347. #define SQL_INTERVAL_DAY_TO_HOUR (-87)
  348. #define SQL_INTERVAL_DAY_TO_MINUTE (-88)
  349. #define SQL_INTERVAL_DAY_TO_SECOND (-89)
  350. #define SQL_INTERVAL_HOUR_TO_MINUTE (-90)
  351. #define SQL_INTERVAL_HOUR_TO_SECOND (-91)
  352. #define SQL_INTERVAL_MINUTE_TO_SECOND (-92)
  353. #endif /* ODBCVER >= 0x0300 */
  354. #if (ODBCVER <= 0x0300)
  355. #define SQL_UNICODE (-95)
  356. #define SQL_UNICODE_VARCHAR (-96)
  357. #define SQL_UNICODE_LONGVARCHAR (-97)
  358. #define SQL_UNICODE_CHAR SQL_UNICODE
  359. #else
  360. /* The previous definitions for SQL_UNICODE_ are historical and obsolete */
  361. #define SQL_UNICODE SQL_WCHAR
  362. #define SQL_UNICODE_VARCHAR SQL_WVARCHAR
  363. #define SQL_UNICODE_LONGVARCHAR SQL_WLONGVARCHAR
  364. #define SQL_UNICODE_CHAR SQL_WCHAR
  365. #endif
  366. #if (ODBCVER < 0x0300)
  367. #define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR
  368. #define SQL_TYPE_DRIVER_END SQL_UNICODE_LONGVARCHAR
  369. #endif /* ODBCVER < 0x0300 */
  370. /* C datatype to SQL datatype mapping SQL types
  371. ------------------- */
  372. #define SQL_C_CHAR SQL_CHAR /* CHAR, VARCHAR, DECIMAL, NUMERIC */
  373. #define SQL_C_LONG SQL_INTEGER /* INTEGER */
  374. #define SQL_C_SHORT SQL_SMALLINT /* SMALLINT */
  375. #define SQL_C_FLOAT SQL_REAL /* REAL */
  376. #define SQL_C_DOUBLE SQL_DOUBLE /* FLOAT, DOUBLE */
  377. #if (ODBCVER >= 0x0300)
  378. #define SQL_C_NUMERIC SQL_NUMERIC
  379. #endif /* ODBCVER >= 0x0300 */
  380. #define SQL_C_DEFAULT 99
  381. #define SQL_SIGNED_OFFSET (-20)
  382. #define SQL_UNSIGNED_OFFSET (-22)
  383. /* C datatype to SQL datatype mapping */
  384. #define SQL_C_DATE SQL_DATE
  385. #define SQL_C_TIME SQL_TIME
  386. #define SQL_C_TIMESTAMP SQL_TIMESTAMP
  387. #if (ODBCVER >= 0x0300)
  388. #define SQL_C_TYPE_DATE SQL_TYPE_DATE
  389. #define SQL_C_TYPE_TIME SQL_TYPE_TIME
  390. #define SQL_C_TYPE_TIMESTAMP SQL_TYPE_TIMESTAMP
  391. #define SQL_C_INTERVAL_YEAR SQL_INTERVAL_YEAR
  392. #define SQL_C_INTERVAL_MONTH SQL_INTERVAL_MONTH
  393. #define SQL_C_INTERVAL_DAY SQL_INTERVAL_DAY
  394. #define SQL_C_INTERVAL_HOUR SQL_INTERVAL_HOUR
  395. #define SQL_C_INTERVAL_MINUTE SQL_INTERVAL_MINUTE
  396. #define SQL_C_INTERVAL_SECOND SQL_INTERVAL_SECOND
  397. #define SQL_C_INTERVAL_YEAR_TO_MONTH SQL_INTERVAL_YEAR_TO_MONTH
  398. #define SQL_C_INTERVAL_DAY_TO_HOUR SQL_INTERVAL_DAY_TO_HOUR
  399. #define SQL_C_INTERVAL_DAY_TO_MINUTE SQL_INTERVAL_DAY_TO_MINUTE
  400. #define SQL_C_INTERVAL_DAY_TO_SECOND SQL_INTERVAL_DAY_TO_SECOND
  401. #define SQL_C_INTERVAL_HOUR_TO_MINUTE SQL_INTERVAL_HOUR_TO_MINUTE
  402. #define SQL_C_INTERVAL_HOUR_TO_SECOND SQL_INTERVAL_HOUR_TO_SECOND
  403. #define SQL_C_INTERVAL_MINUTE_TO_SECOND SQL_INTERVAL_MINUTE_TO_SECOND
  404. #endif /* ODBCVER >= 0x0300 */
  405. #define SQL_C_BINARY SQL_BINARY
  406. #define SQL_C_BIT SQL_BIT
  407. #if (ODBCVER >= 0x0300)
  408. #define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */
  409. #define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
  410. #endif /* ODBCVER >= 0x0300 */
  411. #define SQL_C_TINYINT SQL_TINYINT
  412. #define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET) /* SIGNED INTEGER */
  413. #define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET) /* SIGNED SMALLINT */
  414. #define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET) /* SIGNED TINYINT */
  415. #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/
  416. #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/
  417. #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/
  418. #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */
  419. #if (ODBCVER >= 0x0350)
  420. #define SQL_C_GUID SQL_GUID
  421. #endif /* ODBCVER >= 0x0350 */
  422. #define SQL_TYPE_NULL 0
  423. #if (ODBCVER < 0x0300)
  424. #define SQL_TYPE_MIN SQL_BIT
  425. #define SQL_TYPE_MAX SQL_VARCHAR
  426. #endif
  427. #if (ODBCVER >= 0x0300)
  428. #define SQL_C_VARBOOKMARK SQL_C_BINARY
  429. #endif /* ODBCVER >= 0x0300 */
  430. /* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */
  431. #if (ODBCVER >= 0x0300)
  432. #define SQL_NO_ROW_NUMBER (-1)
  433. #define SQL_NO_COLUMN_NUMBER (-1)
  434. #define SQL_ROW_NUMBER_UNKNOWN (-2)
  435. #define SQL_COLUMN_NUMBER_UNKNOWN (-2)
  436. #endif
  437. /* SQLBindParameter extensions */
  438. #define SQL_DEFAULT_PARAM (-5)
  439. #define SQL_IGNORE (-6)
  440. #if (ODBCVER >= 0x0300)
  441. #define SQL_COLUMN_IGNORE SQL_IGNORE
  442. #endif /* ODBCVER >= 0x0300 */
  443. #define SQL_LEN_DATA_AT_EXEC_OFFSET (-100)
  444. #define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
  445. /* binary length for driver specific attributes */
  446. #define SQL_LEN_BINARY_ATTR_OFFSET (-100)
  447. #define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)
  448. /* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter
  449. */
  450. #define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT
  451. #define SQL_SETPARAM_VALUE_MAX (-1L)
  452. /* SQLColAttributes defines */
  453. #define SQL_COLUMN_COUNT 0
  454. #define SQL_COLUMN_NAME 1
  455. #define SQL_COLUMN_TYPE 2
  456. #define SQL_COLUMN_LENGTH 3
  457. #define SQL_COLUMN_PRECISION 4
  458. #define SQL_COLUMN_SCALE 5
  459. #define SQL_COLUMN_DISPLAY_SIZE 6
  460. #define SQL_COLUMN_NULLABLE 7
  461. #define SQL_COLUMN_UNSIGNED 8
  462. #define SQL_COLUMN_MONEY 9
  463. #define SQL_COLUMN_UPDATABLE 10
  464. #define SQL_COLUMN_AUTO_INCREMENT 11
  465. #define SQL_COLUMN_CASE_SENSITIVE 12
  466. #define SQL_COLUMN_SEARCHABLE 13
  467. #define SQL_COLUMN_TYPE_NAME 14
  468. #define SQL_COLUMN_TABLE_NAME 15
  469. #define SQL_COLUMN_OWNER_NAME 16
  470. #define SQL_COLUMN_QUALIFIER_NAME 17
  471. #define SQL_COLUMN_LABEL 18
  472. #define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL
  473. #if (ODBCVER < 0x0300)
  474. #define SQL_COLUMN_DRIVER_START 1000
  475. #endif /* ODBCVER < 0x0300 */
  476. #define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT
  477. /* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */
  478. #define SQL_ATTR_READONLY 0
  479. #define SQL_ATTR_WRITE 1
  480. #define SQL_ATTR_READWRITE_UNKNOWN 2
  481. /* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */
  482. /* These are also used by SQLGetInfo */
  483. #define SQL_UNSEARCHABLE 0
  484. #define SQL_LIKE_ONLY 1
  485. #define SQL_ALL_EXCEPT_LIKE 2
  486. #define SQL_SEARCHABLE 3
  487. #define SQL_PRED_SEARCHABLE SQL_SEARCHABLE
  488. /* Special return values for SQLGetData */
  489. #define SQL_NO_TOTAL (-4)
  490. /********************************************/
  491. /* SQLGetFunctions: additional values for */
  492. /* fFunction to represent functions that */
  493. /* are not in the X/Open spec. */
  494. /********************************************/
  495. #if (ODBCVER >= 0x0300)
  496. #define SQL_API_SQLALLOCHANDLESTD 73
  497. #define SQL_API_SQLBULKOPERATIONS 24
  498. #endif /* ODBCVER >= 0x0300 */
  499. #define SQL_API_SQLBINDPARAMETER 72
  500. #define SQL_API_SQLBROWSECONNECT 55
  501. #define SQL_API_SQLCOLATTRIBUTES 6
  502. #define SQL_API_SQLCOLUMNPRIVILEGES 56
  503. #define SQL_API_SQLDESCRIBEPARAM 58
  504. #define SQL_API_SQLDRIVERCONNECT 41
  505. #define SQL_API_SQLDRIVERS 71
  506. #define SQL_API_SQLEXTENDEDFETCH 59
  507. #define SQL_API_SQLFOREIGNKEYS 60
  508. #define SQL_API_SQLMORERESULTS 61
  509. #define SQL_API_SQLNATIVESQL 62
  510. #define SQL_API_SQLNUMPARAMS 63
  511. #define SQL_API_SQLPARAMOPTIONS 64
  512. #define SQL_API_SQLPRIMARYKEYS 65
  513. #define SQL_API_SQLPROCEDURECOLUMNS 66
  514. #define SQL_API_SQLPROCEDURES 67
  515. #define SQL_API_SQLSETPOS 68
  516. #define SQL_API_SQLSETSCROLLOPTIONS 69
  517. #define SQL_API_SQLTABLEPRIVILEGES 70
  518. /*-------------------------------------------*/
  519. /* SQL_EXT_API_LAST is not useful with ODBC */
  520. /* version 3.0 because some of the values */
  521. /* from X/Open are in the 10000 range. */
  522. /*-------------------------------------------*/
  523. #if (ODBCVER < 0x0300)
  524. #define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER
  525. #define SQL_NUM_FUNCTIONS 23
  526. #define SQL_EXT_API_START 40
  527. #define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1)
  528. #endif
  529. /*--------------------------------------------*/
  530. /* SQL_API_ALL_FUNCTIONS returns an array */
  531. /* of 'booleans' representing whether a */
  532. /* function is implemented by the driver. */
  533. /* */
  534. /* CAUTION: Only functions defined in ODBC */
  535. /* version 2.0 and earlier are returned, the */
  536. /* new high-range function numbers defined by */
  537. /* X/Open break this scheme. See the new */
  538. /* method -- SQL_API_ODBC3_ALL_FUNCTIONS */
  539. /*--------------------------------------------*/
  540. #define SQL_API_ALL_FUNCTIONS 0 /* See CAUTION above */
  541. /*----------------------------------------------*/
  542. /* 2.X drivers export a dummy function with */
  543. /* ordinal number SQL_API_LOADBYORDINAL to speed*/
  544. /* loading under the windows operating system. */
  545. /* */
  546. /* CAUTION: Loading by ordinal is not supported */
  547. /* for 3.0 and above drivers. */
  548. /*----------------------------------------------*/
  549. #define SQL_API_LOADBYORDINAL 199 /* See CAUTION above */
  550. /*----------------------------------------------*/
  551. /* SQL_API_ODBC3_ALL_FUNCTIONS */
  552. /* This returns a bitmap, which allows us to */
  553. /* handle the higher-valued function numbers. */
  554. /* Use SQL_FUNC_EXISTS(bitmap,function_number) */
  555. /* to determine if the function exists. */
  556. /*----------------------------------------------*/
  557. #if (ODBCVER >= 0x0300)
  558. #define SQL_API_ODBC3_ALL_FUNCTIONS 999
  559. #define SQL_API_ODBC3_ALL_FUNCTIONS_SIZE 250 /* array of 250 words */
  560. #define SQL_FUNC_EXISTS(pfExists, uwAPI) \
  561. ((*(((UWORD*) (pfExists)) + ((uwAPI) >> 4)) \
  562. & (1 << ((uwAPI) & 0x000F)) \
  563. ) ? SQL_TRUE : SQL_FALSE \
  564. )
  565. #endif /* ODBCVER >= 0x0300 */
  566. /************************************************/
  567. /* Extended definitions for SQLGetInfo */
  568. /************************************************/
  569. /*---------------------------------*/
  570. /* Values in ODBC 2.0 that are not */
  571. /* in the X/Open spec */
  572. /*---------------------------------*/
  573. #define SQL_INFO_FIRST 0
  574. #define SQL_ACTIVE_CONNECTIONS 0 /* MAX_DRIVER_CONNECTIONS */
  575. #define SQL_ACTIVE_STATEMENTS 1 /* MAX_CONCURRENT_ACTIVITIES */
  576. #define SQL_DRIVER_HDBC 3
  577. #define SQL_DRIVER_HENV 4
  578. #define SQL_DRIVER_HSTMT 5
  579. #define SQL_DRIVER_NAME 6
  580. #define SQL_DRIVER_VER 7
  581. #define SQL_ODBC_API_CONFORMANCE 9
  582. #define SQL_ODBC_VER 10
  583. #define SQL_ROW_UPDATES 11
  584. #define SQL_ODBC_SAG_CLI_CONFORMANCE 12
  585. #define SQL_ODBC_SQL_CONFORMANCE 15
  586. #define SQL_PROCEDURES 21
  587. #define SQL_CONCAT_NULL_BEHAVIOR 22
  588. #define SQL_CURSOR_ROLLBACK_BEHAVIOR 24
  589. #define SQL_EXPRESSIONS_IN_ORDERBY 27
  590. #define SQL_MAX_OWNER_NAME_LEN 32 /* MAX_SCHEMA_NAME_LEN */
  591. #define SQL_MAX_PROCEDURE_NAME_LEN 33
  592. #define SQL_MAX_QUALIFIER_NAME_LEN 34 /* MAX_CATALOG_NAME_LEN */
  593. #define SQL_MULT_RESULT_SETS 36
  594. #define SQL_MULTIPLE_ACTIVE_TXN 37
  595. #define SQL_OUTER_JOINS 38
  596. #define SQL_OWNER_TERM 39
  597. #define SQL_PROCEDURE_TERM 40
  598. #define SQL_QUALIFIER_NAME_SEPARATOR 41
  599. #define SQL_QUALIFIER_TERM 42
  600. #define SQL_SCROLL_OPTIONS 44
  601. #define SQL_TABLE_TERM 45
  602. #define SQL_CONVERT_FUNCTIONS 48
  603. #define SQL_NUMERIC_FUNCTIONS 49
  604. #define SQL_STRING_FUNCTIONS 50
  605. #define SQL_SYSTEM_FUNCTIONS 51
  606. #define SQL_TIMEDATE_FUNCTIONS 52
  607. #define SQL_CONVERT_BIGINT 53
  608. #define SQL_CONVERT_BINARY 54
  609. #define SQL_CONVERT_BIT 55
  610. #define SQL_CONVERT_CHAR 56
  611. #define SQL_CONVERT_DATE 57
  612. #define SQL_CONVERT_DECIMAL 58
  613. #define SQL_CONVERT_DOUBLE 59
  614. #define SQL_CONVERT_FLOAT 60
  615. #define SQL_CONVERT_INTEGER 61
  616. #define SQL_CONVERT_LONGVARCHAR 62
  617. #define SQL_CONVERT_NUMERIC 63
  618. #define SQL_CONVERT_REAL 64
  619. #define SQL_CONVERT_SMALLINT 65
  620. #define SQL_CONVERT_TIME 66
  621. #define SQL_CONVERT_TIMESTAMP 67
  622. #define SQL_CONVERT_TINYINT 68
  623. #define SQL_CONVERT_VARBINARY 69
  624. #define SQL_CONVERT_VARCHAR 70
  625. #define SQL_CONVERT_LONGVARBINARY 71
  626. #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */
  627. #define SQL_CORRELATION_NAME 74
  628. #define SQL_NON_NULLABLE_COLUMNS 75
  629. #define SQL_DRIVER_HLIB 76
  630. #define SQL_DRIVER_ODBC_VER 77
  631. #define SQL_LOCK_TYPES 78
  632. #define SQL_POS_OPERATIONS 79
  633. #define SQL_POSITIONED_STATEMENTS 80
  634. #define SQL_BOOKMARK_PERSISTENCE 82
  635. #define SQL_STATIC_SENSITIVITY 83
  636. #define SQL_FILE_USAGE 84
  637. #define SQL_COLUMN_ALIAS 87
  638. #define SQL_GROUP_BY 88
  639. #define SQL_KEYWORDS 89
  640. #define SQL_OWNER_USAGE 91
  641. #define SQL_QUALIFIER_USAGE 92
  642. #define SQL_QUOTED_IDENTIFIER_CASE 93
  643. #define SQL_SUBQUERIES 95
  644. #define SQL_UNION 96
  645. #define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103
  646. #define SQL_MAX_CHAR_LITERAL_LEN 108
  647. #define SQL_TIMEDATE_ADD_INTERVALS 109
  648. #define SQL_TIMEDATE_DIFF_INTERVALS 110
  649. #define SQL_NEED_LONG_DATA_LEN 111
  650. #define SQL_MAX_BINARY_LITERAL_LEN 112
  651. #define SQL_LIKE_ESCAPE_CLAUSE 113
  652. #define SQL_QUALIFIER_LOCATION 114
  653. #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300)
  654. #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */
  655. #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */
  656. /*----------------------------------------------*/
  657. /* SQL_INFO_LAST and SQL_INFO_DRIVER_START are */
  658. /* not useful anymore, because X/Open has */
  659. /* values in the 10000 range. You */
  660. /* must contact X/Open directly to get a range */
  661. /* of numbers for driver-specific values. */
  662. /*----------------------------------------------*/
  663. #if (ODBCVER < 0x0300)
  664. #define SQL_INFO_LAST SQL_QUALIFIER_LOCATION
  665. #define SQL_INFO_DRIVER_START 1000
  666. #endif /* ODBCVER < 0x0300 */
  667. /*-----------------------------------------------*/
  668. /* ODBC 3.0 SQLGetInfo values that are not part */
  669. /* of the X/Open standard at this time. X/Open */
  670. /* standard values are in sql.h. */
  671. /*-----------------------------------------------*/
  672. #if (ODBCVER >= 0x0300)
  673. #define SQL_ACTIVE_ENVIRONMENTS 116
  674. #define SQL_ALTER_DOMAIN 117
  675. #define SQL_SQL_CONFORMANCE 118
  676. #define SQL_DATETIME_LITERALS 119
  677. #define SQL_ASYNC_MODE 10021 /* new X/Open spec */
  678. #define SQL_BATCH_ROW_COUNT 120
  679. #define SQL_BATCH_SUPPORT 121
  680. #define SQL_CATALOG_LOCATION SQL_QUALIFIER_LOCATION
  681. #define SQL_CATALOG_NAME_SEPARATOR SQL_QUALIFIER_NAME_SEPARATOR
  682. #define SQL_CATALOG_TERM SQL_QUALIFIER_TERM
  683. #define SQL_CATALOG_USAGE SQL_QUALIFIER_USAGE
  684. #define SQL_CONVERT_WCHAR 122
  685. #define SQL_CONVERT_INTERVAL_DAY_TIME 123
  686. #define SQL_CONVERT_INTERVAL_YEAR_MONTH 124
  687. #define SQL_CONVERT_WLONGVARCHAR 125
  688. #define SQL_CONVERT_WVARCHAR 126
  689. #define SQL_CREATE_ASSERTION 127
  690. #define SQL_CREATE_CHARACTER_SET 128
  691. #define SQL_CREATE_COLLATION 129
  692. #define SQL_CREATE_DOMAIN 130
  693. #define SQL_CREATE_SCHEMA 131
  694. #define SQL_CREATE_TABLE 132
  695. #define SQL_CREATE_TRANSLATION 133
  696. #define SQL_CREATE_VIEW 134
  697. #define SQL_DRIVER_HDESC 135
  698. #define SQL_DROP_ASSERTION 136
  699. #define SQL_DROP_CHARACTER_SET 137
  700. #define SQL_DROP_COLLATION 138
  701. #define SQL_DROP_DOMAIN 139
  702. #define SQL_DROP_SCHEMA 140
  703. #define SQL_DROP_TABLE 141
  704. #define SQL_DROP_TRANSLATION 142
  705. #define SQL_DROP_VIEW 143
  706. #define SQL_DYNAMIC_CURSOR_ATTRIBUTES1 144
  707. #define SQL_DYNAMIC_CURSOR_ATTRIBUTES2 145
  708. #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146
  709. #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 147
  710. #define SQL_INDEX_KEYWORDS 148
  711. #define SQL_INFO_SCHEMA_VIEWS 149
  712. #define SQL_KEYSET_CURSOR_ATTRIBUTES1 150
  713. #define SQL_KEYSET_CURSOR_ATTRIBUTES2 151
  714. #define SQL_MAX_ASYNC_CONCURRENT_STATEMENTS 10022 /* new X/Open spec */
  715. #define SQL_ODBC_INTERFACE_CONFORMANCE 152
  716. #define SQL_PARAM_ARRAY_ROW_COUNTS 153
  717. #define SQL_PARAM_ARRAY_SELECTS 154
  718. #define SQL_SCHEMA_TERM SQL_OWNER_TERM
  719. #define SQL_SCHEMA_USAGE SQL_OWNER_USAGE
  720. #define SQL_SQL92_DATETIME_FUNCTIONS 155
  721. #define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156
  722. #define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157
  723. #define SQL_SQL92_GRANT 158
  724. #define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 159
  725. #define SQL_SQL92_PREDICATES 160
  726. #define SQL_SQL92_RELATIONAL_JOIN_OPERATORS 161
  727. #define SQL_SQL92_REVOKE 162
  728. #define SQL_SQL92_ROW_VALUE_CONSTRUCTOR 163
  729. #define SQL_SQL92_STRING_FUNCTIONS 164
  730. #define SQL_SQL92_VALUE_EXPRESSIONS 165
  731. #define SQL_STANDARD_CLI_CONFORMANCE 166
  732. #define SQL_STATIC_CURSOR_ATTRIBUTES1 167
  733. #define SQL_STATIC_CURSOR_ATTRIBUTES2 168
  734. #define SQL_AGGREGATE_FUNCTIONS 169
  735. #define SQL_DDL_INDEX 170
  736. #define SQL_DM_VER 171
  737. #define SQL_INSERT_STATEMENT 172
  738. #define SQL_CONVERT_GUID 173
  739. #define SQL_UNION_STATEMENT SQL_UNION
  740. #endif /* ODBCVER >= 0x0300 */
  741. #define SQL_DTC_TRANSITION_COST 1750
  742. /* SQL_ALTER_TABLE bitmasks */
  743. #if (ODBCVER >= 0x0300)
  744. /* the following 5 bitmasks are defined in sql.h
  745. *#define SQL_AT_ADD_COLUMN 0x00000001L
  746. *#define SQL_AT_DROP_COLUMN 0x00000002L
  747. *#define SQL_AT_ADD_CONSTRAINT 0x00000008L
  748. */
  749. #define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L
  750. #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
  751. #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
  752. #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
  753. #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
  754. #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
  755. #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
  756. #define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
  757. #define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
  758. #define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
  759. #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
  760. #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
  761. #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
  762. #define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
  763. #define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
  764. #endif /* ODBCVER >= 0x0300 */
  765. /* SQL_CONVERT_* return value bitmasks */
  766. #define SQL_CVT_CHAR 0x00000001L
  767. #define SQL_CVT_NUMERIC 0x00000002L
  768. #define SQL_CVT_DECIMAL 0x00000004L
  769. #define SQL_CVT_INTEGER 0x00000008L
  770. #define SQL_CVT_SMALLINT 0x00000010L
  771. #define SQL_CVT_FLOAT 0x00000020L
  772. #define SQL_CVT_REAL 0x00000040L
  773. #define SQL_CVT_DOUBLE 0x00000080L
  774. #define SQL_CVT_VARCHAR 0x00000100L
  775. #define SQL_CVT_LONGVARCHAR 0x00000200L
  776. #define SQL_CVT_BINARY 0x00000400L
  777. #define SQL_CVT_VARBINARY 0x00000800L
  778. #define SQL_CVT_BIT 0x00001000L
  779. #define SQL_CVT_TINYINT 0x00002000L
  780. #define SQL_CVT_BIGINT 0x00004000L
  781. #define SQL_CVT_DATE 0x00008000L
  782. #define SQL_CVT_TIME 0x00010000L
  783. #define SQL_CVT_TIMESTAMP 0x00020000L
  784. #define SQL_CVT_LONGVARBINARY 0x00040000L
  785. #if (ODBCVER >= 0x0300)
  786. #define SQL_CVT_INTERVAL_YEAR_MONTH 0x00080000L
  787. #define SQL_CVT_INTERVAL_DAY_TIME 0x00100000L
  788. #define SQL_CVT_WCHAR 0x00200000L
  789. #define SQL_CVT_WLONGVARCHAR 0x00400000L
  790. #define SQL_CVT_WVARCHAR 0x00800000L
  791. #define SQL_CVT_GUID 0x01000000L
  792. #endif /* ODBCVER >= 0x0300 */
  793. /* SQL_CONVERT_FUNCTIONS functions */
  794. #define SQL_FN_CVT_CONVERT 0x00000001L
  795. #if (ODBCVER >= 0x0300)
  796. #define SQL_FN_CVT_CAST 0x00000002L
  797. #endif /* ODBCVER >= 0x0300 */
  798. /* SQL_STRING_FUNCTIONS functions */
  799. #define SQL_FN_STR_CONCAT 0x00000001L
  800. #define SQL_FN_STR_INSERT 0x00000002L
  801. #define SQL_FN_STR_LEFT 0x00000004L
  802. #define SQL_FN_STR_LTRIM 0x00000008L
  803. #define SQL_FN_STR_LENGTH 0x00000010L
  804. #define SQL_FN_STR_LOCATE 0x00000020L
  805. #define SQL_FN_STR_LCASE 0x00000040L
  806. #define SQL_FN_STR_REPEAT 0x00000080L
  807. #define SQL_FN_STR_REPLACE 0x00000100L
  808. #define SQL_FN_STR_RIGHT 0x00000200L
  809. #define SQL_FN_STR_RTRIM 0x00000400L
  810. #define SQL_FN_STR_SUBSTRING 0x00000800L
  811. #define SQL_FN_STR_UCASE 0x00001000L
  812. #define SQL_FN_STR_ASCII 0x00002000L
  813. #define SQL_FN_STR_CHAR 0x00004000L
  814. #define SQL_FN_STR_DIFFERENCE 0x00008000L
  815. #define SQL_FN_STR_LOCATE_2 0x00010000L
  816. #define SQL_FN_STR_SOUNDEX 0x00020000L
  817. #define SQL_FN_STR_SPACE 0x00040000L
  818. #if (ODBCVER >= 0x0300)
  819. #define SQL_FN_STR_BIT_LENGTH 0x00080000L
  820. #define SQL_FN_STR_CHAR_LENGTH 0x00100000L
  821. #define SQL_FN_STR_CHARACTER_LENGTH 0x00200000L
  822. #define SQL_FN_STR_OCTET_LENGTH 0x00400000L
  823. #define SQL_FN_STR_POSITION 0x00800000L
  824. #endif /* ODBCVER >= 0x0300 */
  825. /* SQL_SQL92_STRING_FUNCTIONS */
  826. #if (ODBCVER >= 0x0300)
  827. #define SQL_SSF_CONVERT 0x00000001L
  828. #define SQL_SSF_LOWER 0x00000002L
  829. #define SQL_SSF_UPPER 0x00000004L
  830. #define SQL_SSF_SUBSTRING 0x00000008L
  831. #define SQL_SSF_TRANSLATE 0x00000010L
  832. #define SQL_SSF_TRIM_BOTH 0x00000020L
  833. #define SQL_SSF_TRIM_LEADING 0x00000040L
  834. #define SQL_SSF_TRIM_TRAILING 0x00000080L
  835. #endif /* ODBCVER >= 0x0300 */
  836. /* SQL_NUMERIC_FUNCTIONS functions */
  837. #define SQL_FN_NUM_ABS 0x00000001L
  838. #define SQL_FN_NUM_ACOS 0x00000002L
  839. #define SQL_FN_NUM_ASIN 0x00000004L
  840. #define SQL_FN_NUM_ATAN 0x00000008L
  841. #define SQL_FN_NUM_ATAN2 0x00000010L
  842. #define SQL_FN_NUM_CEILING 0x00000020L
  843. #define SQL_FN_NUM_COS 0x00000040L
  844. #define SQL_FN_NUM_COT 0x00000080L
  845. #define SQL_FN_NUM_EXP 0x00000100L
  846. #define SQL_FN_NUM_FLOOR 0x00000200L
  847. #define SQL_FN_NUM_LOG 0x00000400L
  848. #define SQL_FN_NUM_MOD 0x00000800L
  849. #define SQL_FN_NUM_SIGN 0x00001000L
  850. #define SQL_FN_NUM_SIN 0x00002000L
  851. #define SQL_FN_NUM_SQRT 0x00004000L
  852. #define SQL_FN_NUM_TAN 0x00008000L
  853. #define SQL_FN_NUM_PI 0x00010000L
  854. #define SQL_FN_NUM_RAND 0x00020000L
  855. #define SQL_FN_NUM_DEGREES 0x00040000L
  856. #define SQL_FN_NUM_LOG10 0x00080000L
  857. #define SQL_FN_NUM_POWER 0x00100000L
  858. #define SQL_FN_NUM_RADIANS 0x00200000L
  859. #define SQL_FN_NUM_ROUND 0x00400000L
  860. #define SQL_FN_NUM_TRUNCATE 0x00800000L
  861. /* SQL_SQL92_NUMERIC_VALUE_FUNCTIONS */
  862. #if (ODBCVER >= 0x0300)
  863. #define SQL_SNVF_BIT_LENGTH 0x00000001L
  864. #define SQL_SNVF_CHAR_LENGTH 0x00000002L
  865. #define SQL_SNVF_CHARACTER_LENGTH 0x00000004L
  866. #define SQL_SNVF_EXTRACT 0x00000008L
  867. #define SQL_SNVF_OCTET_LENGTH 0x00000010L
  868. #define SQL_SNVF_POSITION 0x00000020L
  869. #endif /* ODBCVER >= 0x0300 */
  870. /* SQL_TIMEDATE_FUNCTIONS functions */
  871. #define SQL_FN_TD_NOW 0x00000001L
  872. #define SQL_FN_TD_CURDATE 0x00000002L
  873. #define SQL_FN_TD_DAYOFMONTH 0x00000004L
  874. #define SQL_FN_TD_DAYOFWEEK 0x00000008L
  875. #define SQL_FN_TD_DAYOFYEAR 0x00000010L
  876. #define SQL_FN_TD_MONTH 0x00000020L
  877. #define SQL_FN_TD_QUARTER 0x00000040L
  878. #define SQL_FN_TD_WEEK 0x00000080L
  879. #define SQL_FN_TD_YEAR 0x00000100L
  880. #define SQL_FN_TD_CURTIME 0x00000200L
  881. #define SQL_FN_TD_HOUR 0x00000400L
  882. #define SQL_FN_TD_MINUTE 0x00000800L
  883. #define SQL_FN_TD_SECOND 0x00001000L
  884. #define SQL_FN_TD_TIMESTAMPADD 0x00002000L
  885. #define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L
  886. #define SQL_FN_TD_DAYNAME 0x00008000L
  887. #define SQL_FN_TD_MONTHNAME 0x00010000L
  888. #if (ODBCVER >= 0x0300)
  889. #define SQL_FN_TD_CURRENT_DATE 0x00020000L
  890. #define SQL_FN_TD_CURRENT_TIME 0x00040000L
  891. #define SQL_FN_TD_CURRENT_TIMESTAMP 0x00080000L
  892. #define SQL_FN_TD_EXTRACT 0x00100000L
  893. #endif /* ODBCVER >= 0x0300 */
  894. /* SQL_SQL92_DATETIME_FUNCTIONS */
  895. #if (ODBCVER >= 0x0300)
  896. #define SQL_SDF_CURRENT_DATE 0x00000001L
  897. #define SQL_SDF_CURRENT_TIME 0x00000002L
  898. #define SQL_SDF_CURRENT_TIMESTAMP 0x00000004L
  899. #endif /* ODBCVER >= 0x0300 */
  900. /* SQL_SYSTEM_FUNCTIONS functions */
  901. #define SQL_FN_SYS_USERNAME 0x00000001L
  902. #define SQL_FN_SYS_DBNAME 0x00000002L
  903. #define SQL_FN_SYS_IFNULL 0x00000004L
  904. /* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */
  905. #define SQL_FN_TSI_FRAC_SECOND 0x00000001L
  906. #define SQL_FN_TSI_SECOND 0x00000002L
  907. #define SQL_FN_TSI_MINUTE 0x00000004L
  908. #define SQL_FN_TSI_HOUR 0x00000008L
  909. #define SQL_FN_TSI_DAY 0x00000010L
  910. #define SQL_FN_TSI_WEEK 0x00000020L
  911. #define SQL_FN_TSI_MONTH 0x00000040L
  912. #define SQL_FN_TSI_QUARTER 0x00000080L
  913. #define SQL_FN_TSI_YEAR 0x00000100L
  914. /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES1,
  915. * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1,
  916. * SQL_KEYSET_CURSOR_ATTRIBUTES1, and SQL_STATIC_CURSOR_ATTRIBUTES1
  917. */
  918. #if (ODBCVER >= 0x0300)
  919. /* supported SQLFetchScroll FetchOrientation's */
  920. #define SQL_CA1_NEXT 0x00000001L
  921. #define SQL_CA1_ABSOLUTE 0x00000002L
  922. #define SQL_CA1_RELATIVE 0x00000004L
  923. #define SQL_CA1_BOOKMARK 0x00000008L
  924. /* supported SQLSetPos LockType's */
  925. #define SQL_CA1_LOCK_NO_CHANGE 0x00000040L
  926. #define SQL_CA1_LOCK_EXCLUSIVE 0x00000080L
  927. #define SQL_CA1_LOCK_UNLOCK 0x00000100L
  928. /* supported SQLSetPos Operations */
  929. #define SQL_CA1_POS_POSITION 0x00000200L
  930. #define SQL_CA1_POS_UPDATE 0x00000400L
  931. #define SQL_CA1_POS_DELETE 0x00000800L
  932. #define SQL_CA1_POS_REFRESH 0x00001000L
  933. /* positioned updates and deletes */
  934. #define SQL_CA1_POSITIONED_UPDATE 0x00002000L
  935. #define SQL_CA1_POSITIONED_DELETE 0x00004000L
  936. #define SQL_CA1_SELECT_FOR_UPDATE 0x00008000L
  937. /* supported SQLBulkOperations operations */
  938. #define SQL_CA1_BULK_ADD 0x00010000L
  939. #define SQL_CA1_BULK_UPDATE_BY_BOOKMARK 0x00020000L
  940. #define SQL_CA1_BULK_DELETE_BY_BOOKMARK 0x00040000L
  941. #define SQL_CA1_BULK_FETCH_BY_BOOKMARK 0x00080000L
  942. #endif /* ODBCVER >= 0x0300 */
  943. /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES2,
  944. * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2,
  945. * SQL_KEYSET_CURSOR_ATTRIBUTES2, and SQL_STATIC_CURSOR_ATTRIBUTES2
  946. */
  947. #if (ODBCVER >= 0x0300)
  948. /* supported values for SQL_ATTR_SCROLL_CONCURRENCY */
  949. #define SQL_CA2_READ_ONLY_CONCURRENCY 0x00000001L
  950. #define SQL_CA2_LOCK_CONCURRENCY 0x00000002L
  951. #define SQL_CA2_OPT_ROWVER_CONCURRENCY 0x00000004L
  952. #define SQL_CA2_OPT_VALUES_CONCURRENCY 0x00000008L
  953. /* sensitivity of the cursor to its own inserts, deletes, and updates */
  954. #define SQL_CA2_SENSITIVITY_ADDITIONS 0x00000010L
  955. #define SQL_CA2_SENSITIVITY_DELETIONS 0x00000020L
  956. #define SQL_CA2_SENSITIVITY_UPDATES 0x00000040L
  957. /* semantics of SQL_ATTR_MAX_ROWS */
  958. #define SQL_CA2_MAX_ROWS_SELECT 0x00000080L
  959. #define SQL_CA2_MAX_ROWS_INSERT 0x00000100L
  960. #define SQL_CA2_MAX_ROWS_DELETE 0x00000200L
  961. #define SQL_CA2_MAX_ROWS_UPDATE 0x00000400L
  962. #define SQL_CA2_MAX_ROWS_CATALOG 0x00000800L
  963. #define SQL_CA2_MAX_ROWS_AFFECTS_ALL (SQL_CA2_MAX_ROWS_SELECT | \
  964. SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE | \
  965. SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG)
  966. /* semantics of SQL_DIAG_CURSOR_ROW_COUNT */
  967. #define SQL_CA2_CRC_EXACT 0x00001000L
  968. #define SQL_CA2_CRC_APPROXIMATE 0x00002000L
  969. /* the kinds of positioned statements that can be simulated */
  970. #define SQL_CA2_SIMULATE_NON_UNIQUE 0x00004000L
  971. #define SQL_CA2_SIMULATE_TRY_UNIQUE 0x00008000L
  972. #define SQL_CA2_SIMULATE_UNIQUE 0x00010000L
  973. #endif /* ODBCVER >= 0x0300 */
  974. /* SQL_ODBC_API_CONFORMANCE values */
  975. #define SQL_OAC_NONE 0x0000
  976. #define SQL_OAC_LEVEL1 0x0001
  977. #define SQL_OAC_LEVEL2 0x0002
  978. /* SQL_ODBC_SAG_CLI_CONFORMANCE values */
  979. #define SQL_OSCC_NOT_COMPLIANT 0x0000
  980. #define SQL_OSCC_COMPLIANT 0x0001
  981. /* SQL_ODBC_SQL_CONFORMANCE values */
  982. #define SQL_OSC_MINIMUM 0x0000
  983. #define SQL_OSC_CORE 0x0001
  984. #define SQL_OSC_EXTENDED 0x0002
  985. /* SQL_CONCAT_NULL_BEHAVIOR values */
  986. #define SQL_CB_NULL 0x0000
  987. #define SQL_CB_NON_NULL 0x0001
  988. /* SQL_SCROLL_OPTIONS masks */
  989. #define SQL_SO_FORWARD_ONLY 0x00000001L
  990. #define SQL_SO_KEYSET_DRIVEN 0x00000002L
  991. #define SQL_SO_DYNAMIC 0x00000004L
  992. #define SQL_SO_MIXED 0x00000008L
  993. #define SQL_SO_STATIC 0x00000010L
  994. /* SQL_FETCH_DIRECTION masks */
  995. /* SQL_FETCH_RESUME is no longer supported
  996. #define SQL_FD_FETCH_RESUME 0x00000040L
  997. */
  998. #define SQL_FD_FETCH_BOOKMARK 0x00000080L
  999. /* SQL_TXN_ISOLATION_OPTION masks */
  1000. /* SQL_TXN_VERSIONING is no longer supported
  1001. #define SQL_TXN_VERSIONING 0x00000010L
  1002. */
  1003. /* SQL_CORRELATION_NAME values */
  1004. #define SQL_CN_NONE 0x0000
  1005. #define SQL_CN_DIFFERENT 0x0001
  1006. #define SQL_CN_ANY 0x0002
  1007. /* SQL_NON_NULLABLE_COLUMNS values */
  1008. #define SQL_NNC_NULL 0x0000
  1009. #define SQL_NNC_NON_NULL 0x0001
  1010. /* SQL_NULL_COLLATION values */
  1011. #define SQL_NC_START 0x0002
  1012. #define SQL_NC_END 0x0004
  1013. /* SQL_FILE_USAGE values */
  1014. #define SQL_FILE_NOT_SUPPORTED 0x0000
  1015. #define SQL_FILE_TABLE 0x0001
  1016. #define SQL_FILE_QUALIFIER 0x0002
  1017. #define SQL_FILE_CATALOG SQL_FILE_QUALIFIER // ODBC 3.0
  1018. /* SQL_GETDATA_EXTENSIONS values */
  1019. #define SQL_GD_BLOCK 0x00000004L
  1020. #define SQL_GD_BOUND 0x00000008L
  1021. /* SQL_POSITIONED_STATEMENTS masks */
  1022. #define SQL_PS_POSITIONED_DELETE 0x00000001L
  1023. #define SQL_PS_POSITIONED_UPDATE 0x00000002L
  1024. #define SQL_PS_SELECT_FOR_UPDATE 0x00000004L
  1025. /* SQL_GROUP_BY values */
  1026. #define SQL_GB_NOT_SUPPORTED 0x0000
  1027. #define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001
  1028. #define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002
  1029. #define SQL_GB_NO_RELATION 0x0003
  1030. #if (ODBCVER >= 0x0300)
  1031. #define SQL_GB_COLLATE 0x0004
  1032. #endif /* ODBCVER >= 0x0300 */
  1033. /* SQL_OWNER_USAGE masks */
  1034. #define SQL_OU_DML_STATEMENTS 0x00000001L
  1035. #define SQL_OU_PROCEDURE_INVOCATION 0x00000002L
  1036. #define SQL_OU_TABLE_DEFINITION 0x00000004L
  1037. #define SQL_OU_INDEX_DEFINITION 0x00000008L
  1038. #define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L
  1039. /* SQL_SCHEMA_USAGE masks */
  1040. #if (ODBCVER >= 0x0300)
  1041. #define SQL_SU_DML_STATEMENTS SQL_OU_DML_STATEMENTS
  1042. #define SQL_SU_PROCEDURE_INVOCATION SQL_OU_PROCEDURE_INVOCATION
  1043. #define SQL_SU_TABLE_DEFINITION SQL_OU_TABLE_DEFINITION
  1044. #define SQL_SU_INDEX_DEFINITION SQL_OU_INDEX_DEFINITION
  1045. #define SQL_SU_PRIVILEGE_DEFINITION SQL_OU_PRIVILEGE_DEFINITION
  1046. #endif /* ODBCVER >= 0x0300 */
  1047. /* SQL_QUALIFIER_USAGE masks */
  1048. #define SQL_QU_DML_STATEMENTS 0x00000001L
  1049. #define SQL_QU_PROCEDURE_INVOCATION 0x00000002L
  1050. #define SQL_QU_TABLE_DEFINITION 0x00000004L
  1051. #define SQL_QU_INDEX_DEFINITION 0x00000008L
  1052. #define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L
  1053. #if (ODBCVER >= 0x0300)
  1054. /* SQL_CATALOG_USAGE masks */
  1055. #define SQL_CU_DML_STATEMENTS SQL_QU_DML_STATEMENTS
  1056. #define SQL_CU_PROCEDURE_INVOCATION SQL_QU_PROCEDURE_INVOCATION
  1057. #define SQL_CU_TABLE_DEFINITION SQL_QU_TABLE_DEFINITION
  1058. #define SQL_CU_INDEX_DEFINITION SQL_QU_INDEX_DEFINITION
  1059. #define SQL_CU_PRIVILEGE_DEFINITION SQL_QU_PRIVILEGE_DEFINITION
  1060. #endif /* ODBCVER >= 0x0300 */
  1061. /* SQL_SUBQUERIES masks */
  1062. #define SQL_SQ_COMPARISON 0x00000001L
  1063. #define SQL_SQ_EXISTS 0x00000002L
  1064. #define SQL_SQ_IN 0x00000004L
  1065. #define SQL_SQ_QUANTIFIED 0x00000008L
  1066. #define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L
  1067. /* SQL_UNION masks */
  1068. #define SQL_U_UNION 0x00000001L
  1069. #define SQL_U_UNION_ALL 0x00000002L
  1070. /* SQL_BOOKMARK_PERSISTENCE values */
  1071. #define SQL_BP_CLOSE 0x00000001L
  1072. #define SQL_BP_DELETE 0x00000002L
  1073. #define SQL_BP_DROP 0x00000004L
  1074. #define SQL_BP_TRANSACTION 0x00000008L
  1075. #define SQL_BP_UPDATE 0x00000010L
  1076. #define SQL_BP_OTHER_HSTMT 0x00000020L
  1077. #define SQL_BP_SCROLL 0x00000040L
  1078. /* SQL_STATIC_SENSITIVITY values */
  1079. #define SQL_SS_ADDITIONS 0x00000001L
  1080. #define SQL_SS_DELETIONS 0x00000002L
  1081. #define SQL_SS_UPDATES 0x00000004L
  1082. /* SQL_VIEW values */
  1083. #define SQL_CV_CREATE_VIEW 0x00000001L
  1084. #define SQL_CV_CHECK_OPTION 0x00000002L
  1085. #define SQL_CV_CASCADED 0x00000004L
  1086. #define SQL_CV_LOCAL 0x00000008L
  1087. /* SQL_LOCK_TYPES masks */
  1088. #define SQL_LCK_NO_CHANGE 0x00000001L
  1089. #define SQL_LCK_EXCLUSIVE 0x00000002L
  1090. #define SQL_LCK_UNLOCK 0x00000004L
  1091. /* SQL_POS_OPERATIONS masks */
  1092. #define SQL_POS_POSITION 0x00000001L
  1093. #define SQL_POS_REFRESH 0x00000002L
  1094. #define SQL_POS_UPDATE 0x00000004L
  1095. #define SQL_POS_DELETE 0x00000008L
  1096. #define SQL_POS_ADD 0x00000010L
  1097. /* SQL_QUALIFIER_LOCATION values */
  1098. #define SQL_QL_START 0x0001
  1099. #define SQL_QL_END 0x0002
  1100. /* Here start return values for ODBC 3.0 SQLGetInfo */
  1101. #if (ODBCVER >= 0x0300)
  1102. /* SQL_AGGREGATE_FUNCTIONS bitmasks */
  1103. #define SQL_AF_AVG 0x00000001L
  1104. #define SQL_AF_COUNT 0x00000002L
  1105. #define SQL_AF_MAX 0x00000004L
  1106. #define SQL_AF_MIN 0x00000008L
  1107. #define SQL_AF_SUM 0x00000010L
  1108. #define SQL_AF_DISTINCT 0x00000020L
  1109. #define SQL_AF_ALL 0x00000040L
  1110. /* SQL_SQL_CONFORMANCE bit masks */
  1111. #define SQL_SC_SQL92_ENTRY 0x00000001L
  1112. #define SQL_SC_FIPS127_2_TRANSITIONAL 0x00000002L
  1113. #define SQL_SC_SQL92_INTERMEDIATE 0x00000004L
  1114. #define SQL_SC_SQL92_FULL 0x00000008L
  1115. /* SQL_DATETIME_LITERALS masks */
  1116. #define SQL_DL_SQL92_DATE 0x00000001L
  1117. #define SQL_DL_SQL92_TIME 0x00000002L
  1118. #define SQL_DL_SQL92_TIMESTAMP 0x00000004L
  1119. #define SQL_DL_SQL92_INTERVAL_YEAR 0x00000008L
  1120. #define SQL_DL_SQL92_INTERVAL_MONTH 0x00000010L
  1121. #define SQL_DL_SQL92_INTERVAL_DAY 0x00000020L
  1122. #define SQL_DL_SQL92_INTERVAL_HOUR 0x00000040L
  1123. #define SQL_DL_SQL92_INTERVAL_MINUTE 0x00000080L
  1124. #define SQL_DL_SQL92_INTERVAL_SECOND 0x00000100L
  1125. #define SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH 0x00000200L
  1126. #define SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR 0x00000400L
  1127. #define SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE 0x00000800L
  1128. #define SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND 0x00001000L
  1129. #define SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE 0x00002000L
  1130. #define SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND 0x00004000L
  1131. #define SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND 0x00008000L
  1132. /* SQL_CATALOG_LOCATION values */
  1133. #define SQL_CL_START SQL_QL_START
  1134. #define SQL_CL_END SQL_QL_END
  1135. /* values for SQL_BATCH_ROW_COUNT */
  1136. #define SQL_BRC_PROCEDURES 0x0000001
  1137. #define SQL_BRC_EXPLICIT 0x0000002
  1138. #define SQL_BRC_ROLLED_UP 0x0000004
  1139. /* bitmasks for SQL_BATCH_SUPPORT */
  1140. #define SQL_BS_SELECT_EXPLICIT 0x00000001L
  1141. #define SQL_BS_ROW_COUNT_EXPLICIT 0x00000002L
  1142. #define SQL_BS_SELECT_PROC 0x00000004L
  1143. #define SQL_BS_ROW_COUNT_PROC 0x00000008L
  1144. /* Values for SQL_PARAM_ARRAY_ROW_COUNTS getinfo */
  1145. #define SQL_PARC_BATCH 1
  1146. #define SQL_PARC_NO_BATCH 2
  1147. /* values for SQL_PARAM_ARRAY_SELECTS */
  1148. #define SQL_PAS_BATCH 1
  1149. #define SQL_PAS_NO_BATCH 2
  1150. #define SQL_PAS_NO_SELECT 3
  1151. /* Bitmasks for SQL_INDEX_KEYWORDS */
  1152. #define SQL_IK_NONE 0x00000000L
  1153. #define SQL_IK_ASC 0x00000001L
  1154. #define SQL_IK_DESC 0x00000002L
  1155. #define SQL_IK_ALL (SQL_IK_ASC | SQL_IK_DESC)
  1156. /* Bitmasks for SQL_INFO_SCHEMA_VIEWS */
  1157. #define SQL_ISV_ASSERTIONS 0x00000001L
  1158. #define SQL_ISV_CHARACTER_SETS 0x00000002L
  1159. #define SQL_ISV_CHECK_CONSTRAINTS 0x00000004L
  1160. #define SQL_ISV_COLLATIONS 0x00000008L
  1161. #define SQL_ISV_COLUMN_DOMAIN_USAGE 0x00000010L
  1162. #define SQL_ISV_COLUMN_PRIVILEGES 0x00000020L
  1163. #define SQL_ISV_COLUMNS 0x00000040L
  1164. #define SQL_ISV_CONSTRAINT_COLUMN_USAGE 0x00000080L
  1165. #define SQL_ISV_CONSTRAINT_TABLE_USAGE 0x00000100L
  1166. #define SQL_ISV_DOMAIN_CONSTRAINTS 0x00000200L
  1167. #define SQL_ISV_DOMAINS 0x00000400L
  1168. #define SQL_ISV_KEY_COLUMN_USAGE 0x00000800L
  1169. #define SQL_ISV_REFERENTIAL_CONSTRAINTS 0x00001000L
  1170. #define SQL_ISV_SCHEMATA 0x00002000L
  1171. #define SQL_ISV_SQL_LANGUAGES 0x00004000L
  1172. #define SQL_ISV_TABLE_CONSTRAINTS 0x00008000L
  1173. #define SQL_ISV_TABLE_PRIVILEGES 0x00010000L
  1174. #define SQL_ISV_TABLES 0x00020000L
  1175. #define SQL_ISV_TRANSLATIONS 0x00040000L
  1176. #define SQL_ISV_USAGE_PRIVILEGES 0x00080000L
  1177. #define SQL_ISV_VIEW_COLUMN_USAGE 0x00100000L
  1178. #define SQL_ISV_VIEW_TABLE_USAGE 0x00200000L
  1179. #define SQL_ISV_VIEWS 0x00400000L
  1180. /* Bitmasks for SQL_ASYNC_MODE */
  1181. #define SQL_AM_NONE 0
  1182. #define SQL_AM_CONNECTION 1
  1183. #define SQL_AM_STATEMENT 2
  1184. /* Bitmasks for SQL_ALTER_DOMAIN */
  1185. #define SQL_AD_CONSTRAINT_NAME_DEFINITION 0x00000001L
  1186. #define SQL_AD_ADD_DOMAIN_CONSTRAINT 0x00000002L
  1187. #define SQL_AD_DROP_DOMAIN_CONSTRAINT 0x00000004L
  1188. #define SQL_AD_ADD_DOMAIN_DEFAULT 0x00000008L
  1189. #define SQL_AD_DROP_DOMAIN_DEFAULT 0x00000010L
  1190. #define SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
  1191. #define SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
  1192. #define SQL_AD_ADD_CONSTRAINT_DEFERRABLE 0x00000080L
  1193. #define SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE 0x00000100L
  1194. /* SQL_CREATE_SCHEMA bitmasks */
  1195. #define SQL_CS_CREATE_SCHEMA 0x00000001L
  1196. #define SQL_CS_AUTHORIZATION 0x00000002L
  1197. #define SQL_CS_DEFAULT_CHARACTER_SET 0x00000004L
  1198. /* SQL_CREATE_TRANSLATION bitmasks */
  1199. #define SQL_CTR_CREATE_TRANSLATION 0x00000001L
  1200. /* SQL_CREATE_ASSERTION bitmasks */
  1201. #define SQL_CA_CREATE_ASSERTION 0x00000001L
  1202. #define SQL_CA_CONSTRAINT_INITIALLY_DEFERRED 0x00000010L
  1203. #define SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000020L
  1204. #define SQL_CA_CONSTRAINT_DEFERRABLE 0x00000040L
  1205. #define SQL_CA_CONSTRAINT_NON_DEFERRABLE 0x00000080L
  1206. /* SQL_CREATE_CHARACTER_SET bitmasks */
  1207. #define SQL_CCS_CREATE_CHARACTER_SET 0x00000001L
  1208. #define SQL_CCS_COLLATE_CLAUSE 0x00000002L
  1209. #define SQL_CCS_LIMITED_COLLATION 0x00000004L
  1210. /* SQL_CREATE_COLLATION bitmasks */
  1211. #define SQL_CCOL_CREATE_COLLATION 0x00000001L
  1212. /* SQL_CREATE_DOMAIN bitmasks */
  1213. #define SQL_CDO_CREATE_DOMAIN 0x00000001L
  1214. #define SQL_CDO_DEFAULT 0x00000002L
  1215. #define SQL_CDO_CONSTRAINT 0x00000004L
  1216. #define SQL_CDO_COLLATION 0x00000008L
  1217. #define SQL_CDO_CONSTRAINT_NAME_DEFINITION 0x00000010L
  1218. #define SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
  1219. #define SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
  1220. #define SQL_CDO_CONSTRAINT_DEFERRABLE 0x00000080L
  1221. #define SQL_CDO_CONSTRAINT_NON_DEFERRABLE 0x00000100L
  1222. /* SQL_CREATE_TABLE bitmasks */
  1223. #define SQL_CT_CREATE_TABLE 0x00000001L
  1224. #define SQL_CT_COMMIT_PRESERVE 0x00000002L
  1225. #define SQL_CT_COMMIT_DELETE 0x00000004L
  1226. #define SQL_CT_GLOBAL_TEMPORARY 0x00000008L
  1227. #define SQL_CT_LOCAL_TEMPORARY 0x00000010L
  1228. #define SQL_CT_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
  1229. #define SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
  1230. #define SQL_CT_CONSTRAINT_DEFERRABLE 0x00000080L
  1231. #define SQL_CT_CONSTRAINT_NON_DEFERRABLE 0x00000100L
  1232. #define SQL_CT_COLUMN_CONSTRAINT 0x00000200L
  1233. #define SQL_CT_COLUMN_DEFAULT 0x00000400L
  1234. #define SQL_CT_COLUMN_COLLATION 0x00000800L
  1235. #define SQL_CT_TABLE_CONSTRAINT 0x00001000L
  1236. #define SQL_CT_CONSTRAINT_NAME_DEFINITION 0x00002000L
  1237. /* SQL_DDL_INDEX bitmasks */
  1238. #define SQL_DI_CREATE_INDEX 0x00000001L
  1239. #define SQL_DI_DROP_INDEX 0x00000002L
  1240. /* SQL_DROP_COLLATION bitmasks */
  1241. #define SQL_DC_DROP_COLLATION 0x00000001L
  1242. /* SQL_DROP_DOMAIN bitmasks */
  1243. #define SQL_DD_DROP_DOMAIN 0x00000001L
  1244. #define SQL_DD_RESTRICT 0x00000002L
  1245. #define SQL_DD_CASCADE 0x00000004L
  1246. /* SQL_DROP_SCHEMA bitmasks */
  1247. #define SQL_DS_DROP_SCHEMA 0x00000001L
  1248. #define SQL_DS_RESTRICT 0x00000002L
  1249. #define SQL_DS_CASCADE 0x00000004L
  1250. /* SQL_DROP_CHARACTER_SET bitmasks */
  1251. #define SQL_DCS_DROP_CHARACTER_SET 0x00000001L
  1252. /* SQL_DROP_ASSERTION bitmasks */
  1253. #define SQL_DA_DROP_ASSERTION 0x00000001L
  1254. /* SQL_DROP_TABLE bitmasks */
  1255. #define SQL_DT_DROP_TABLE 0x00000001L
  1256. #define SQL_DT_RESTRICT 0x00000002L
  1257. #define SQL_DT_CASCADE 0x00000004L
  1258. /* SQL_DROP_TRANSLATION bitmasks */
  1259. #define SQL_DTR_DROP_TRANSLATION 0x00000001L
  1260. /* SQL_DROP_VIEW bitmasks */
  1261. #define SQL_DV_DROP_VIEW 0x00000001L
  1262. #define SQL_DV_RESTRICT 0x00000002L
  1263. #define SQL_DV_CASCADE 0x00000004L
  1264. /* SQL_INSERT_STATEMENT bitmasks */
  1265. #define SQL_IS_INSERT_LITERALS 0x00000001L
  1266. #define SQL_IS_INSERT_SEARCHED 0x00000002L
  1267. #define SQL_IS_SELECT_INTO 0x00000004L
  1268. /* SQL_ODBC_INTERFACE_CONFORMANCE values */
  1269. #define SQL_OIC_CORE 1UL
  1270. #define SQL_OIC_LEVEL1 2UL
  1271. #define SQL_OIC_LEVEL2 3UL
  1272. /* SQL_SQL92_FOREIGN_KEY_DELETE_RULE bitmasks */
  1273. #define SQL_SFKD_CASCADE 0x00000001L
  1274. #define SQL_SFKD_NO_ACTION 0x00000002L
  1275. #define SQL_SFKD_SET_DEFAULT 0x00000004L
  1276. #define SQL_SFKD_SET_NULL 0x00000008L
  1277. /* SQL_SQL92_FOREIGN_KEY_UPDATE_RULE bitmasks */
  1278. #define SQL_SFKU_CASCADE 0x00000001L
  1279. #define SQL_SFKU_NO_ACTION 0x00000002L
  1280. #define SQL_SFKU_SET_DEFAULT 0x00000004L
  1281. #define SQL_SFKU_SET_NULL 0x00000008L
  1282. /* SQL_SQL92_GRANT bitmasks */
  1283. #define SQL_SG_USAGE_ON_DOMAIN 0x00000001L
  1284. #define SQL_SG_USAGE_ON_CHARACTER_SET 0x00000002L
  1285. #define SQL_SG_USAGE_ON_COLLATION 0x00000004L
  1286. #define SQL_SG_USAGE_ON_TRANSLATION 0x00000008L
  1287. #define SQL_SG_WITH_GRANT_OPTION 0x00000010L
  1288. #define SQL_SG_DELETE_TABLE 0x00000020L
  1289. #define SQL_SG_INSERT_TABLE 0x00000040L
  1290. #define SQL_SG_INSERT_COLUMN 0x00000080L
  1291. #define SQL_SG_REFERENCES_TABLE 0x00000100L
  1292. #define SQL_SG_REFERENCES_COLUMN 0x00000200L
  1293. #define SQL_SG_SELECT_TABLE 0x00000400L
  1294. #define SQL_SG_UPDATE_TABLE 0x00000800L
  1295. #define SQL_SG_UPDATE_COLUMN 0x00001000L
  1296. /* SQL_SQL92_PREDICATES bitmasks */
  1297. #define SQL_SP_EXISTS 0x00000001L
  1298. #define SQL_SP_ISNOTNULL 0x00000002L
  1299. #define SQL_SP_ISNULL 0x00000004L
  1300. #define SQL_SP_MATCH_FULL 0x00000008L
  1301. #define SQL_SP_MATCH_PARTIAL 0x00000010L
  1302. #define SQL_SP_MATCH_UNIQUE_FULL 0x00000020L
  1303. #define SQL_SP_MATCH_UNIQUE_PARTIAL 0x00000040L
  1304. #define SQL_SP_OVERLAPS 0x00000080L
  1305. #define SQL_SP_UNIQUE 0x00000100L
  1306. #define SQL_SP_LIKE 0x00000200L
  1307. #define SQL_SP_IN 0x00000400L
  1308. #define SQL_SP_BETWEEN 0x00000800L
  1309. #define SQL_SP_COMPARISON 0x00001000L
  1310. #define SQL_SP_QUANTIFIED_COMPARISON 0x00002000L
  1311. /* SQL_SQL92_RELATIONAL_JOIN_OPERATORS bitmasks */
  1312. #define SQL_SRJO_CORRESPONDING_CLAUSE 0x00000001L
  1313. #define SQL_SRJO_CROSS_JOIN 0x00000002L
  1314. #define SQL_SRJO_EXCEPT_JOIN 0x00000004L
  1315. #define SQL_SRJO_FULL_OUTER_JOIN 0x00000008L
  1316. #define SQL_SRJO_INNER_JOIN 0x00000010L
  1317. #define SQL_SRJO_INTERSECT_JOIN 0x00000020L
  1318. #define SQL_SRJO_LEFT_OUTER_JOIN 0x00000040L
  1319. #define SQL_SRJO_NATURAL_JOIN 0x00000080L
  1320. #define SQL_SRJO_RIGHT_OUTER_JOIN 0x00000100L
  1321. #define SQL_SRJO_UNION_JOIN 0x00000200L
  1322. /* SQL_SQL92_REVOKE bitmasks */
  1323. #define SQL_SR_USAGE_ON_DOMAIN 0x00000001L
  1324. #define SQL_SR_USAGE_ON_CHARACTER_SET 0x00000002L
  1325. #define SQL_SR_USAGE_ON_COLLATION 0x00000004L
  1326. #define SQL_SR_USAGE_ON_TRANSLATION 0x00000008L
  1327. #define SQL_SR_GRANT_OPTION_FOR 0x00000010L
  1328. #define SQL_SR_CASCADE 0x00000020L
  1329. #define SQL_SR_RESTRICT 0x00000040L
  1330. #define SQL_SR_DELETE_TABLE 0x00000080L
  1331. #define SQL_SR_INSERT_TABLE 0x00000100L
  1332. #define SQL_SR_INSERT_COLUMN 0x00000200L
  1333. #define SQL_SR_REFERENCES_TABLE 0x00000400L
  1334. #define SQL_SR_REFERENCES_COLUMN 0x00000800L
  1335. #define SQL_SR_SELECT_TABLE 0x00001000L
  1336. #define SQL_SR_UPDATE_TABLE 0x00002000L
  1337. #define SQL_SR_UPDATE_COLUMN 0x00004000L
  1338. /* SQL_SQL92_ROW_VALUE_CONSTRUCTOR bitmasks */
  1339. #define SQL_SRVC_VALUE_EXPRESSION 0x00000001L
  1340. #define SQL_SRVC_NULL 0x00000002L
  1341. #define SQL_SRVC_DEFAULT 0x00000004L
  1342. #define SQL_SRVC_ROW_SUBQUERY 0x00000008L
  1343. /* SQL_SQL92_VALUE_EXPRESSIONS bitmasks */
  1344. #define SQL_SVE_CASE 0x00000001L
  1345. #define SQL_SVE_CAST 0x00000002L
  1346. #define SQL_SVE_COALESCE 0x00000004L
  1347. #define SQL_SVE_NULLIF 0x00000008L
  1348. /* SQL_STANDARD_CLI_CONFORMANCE bitmasks */
  1349. #define SQL_SCC_XOPEN_CLI_VERSION1 0x00000001L
  1350. #define SQL_SCC_ISO92_CLI 0x00000002L
  1351. /* SQL_UNION_STATEMENT bitmasks */
  1352. #define SQL_US_UNION SQL_U_UNION
  1353. #define SQL_US_UNION_ALL SQL_U_UNION_ALL
  1354. #endif /* ODBCVER >= 0x0300 */
  1355. /* SQL_DTC_TRANSITION_COST bitmasks */
  1356. #define SQL_DTC_ENLIST_EXPENSIVE 0x00000001L
  1357. #define SQL_DTC_UNENLIST_EXPENSIVE 0x00000002L
  1358. /* additional SQLDataSources fetch directions */
  1359. #if (ODBCVER >= 0x0300)
  1360. #define SQL_FETCH_FIRST_USER 31
  1361. #define SQL_FETCH_FIRST_SYSTEM 32
  1362. #endif /* ODBCVER >= 0x0300 */
  1363. /* Defines for SQLSetPos */
  1364. #define SQL_ENTIRE_ROWSET 0
  1365. /* Operations in SQLSetPos */
  1366. #define SQL_POSITION 0 /* 1.0 FALSE */
  1367. #define SQL_REFRESH 1 /* 1.0 TRUE */
  1368. #define SQL_UPDATE 2
  1369. #define SQL_DELETE 3
  1370. /* Operations in SQLBulkOperations */
  1371. #define SQL_ADD 4
  1372. #define SQL_SETPOS_MAX_OPTION_VALUE SQL_ADD
  1373. #if (ODBCVER >= 0x0300)
  1374. #define SQL_UPDATE_BY_BOOKMARK 5
  1375. #define SQL_DELETE_BY_BOOKMARK 6
  1376. #define SQL_FETCH_BY_BOOKMARK 7
  1377. #endif /* ODBCVER >= 0x0300 */
  1378. /* Lock options in SQLSetPos */
  1379. #define SQL_LOCK_NO_CHANGE 0 /* 1.0 FALSE */
  1380. #define SQL_LOCK_EXCLUSIVE 1 /* 1.0 TRUE */
  1381. #define SQL_LOCK_UNLOCK 2
  1382. #define SQL_SETPOS_MAX_LOCK_VALUE SQL_LOCK_UNLOCK
  1383. /* Macros for SQLSetPos */
  1384. #define SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE)
  1385. #define SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock)
  1386. #define SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock)
  1387. #define SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE)
  1388. #define SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE)
  1389. #define SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE)
  1390. /* Column types and scopes in SQLSpecialColumns. */
  1391. #define SQL_BEST_ROWID 1
  1392. #define SQL_ROWVER 2
  1393. /* Defines for SQLSpecialColumns (returned in the result set)
  1394. SQL_PC_UNKNOWN and SQL_PC_PSEUDO are defined in sql.h */
  1395. #define SQL_PC_NOT_PSEUDO 1
  1396. /* Defines for SQLStatistics */
  1397. #define SQL_QUICK 0
  1398. #define SQL_ENSURE 1
  1399. /* Defines for SQLStatistics (returned in the result set)
  1400. SQL_INDEX_CLUSTERED, SQL_INDEX_HASHED, and SQL_INDEX_OTHER are
  1401. defined in sql.h */
  1402. #define SQL_TABLE_STAT 0
  1403. /* Defines for SQLTables */
  1404. #if (ODBCVER >= 0x0300)
  1405. #define SQL_ALL_CATALOGS "%"
  1406. #define SQL_ALL_SCHEMAS "%"
  1407. #define SQL_ALL_TABLE_TYPES "%"
  1408. #endif /* ODBCVER >= 0x0300 */
  1409. /* Options for SQLDriverConnect */
  1410. #define SQL_DRIVER_NOPROMPT 0
  1411. #define SQL_DRIVER_COMPLETE 1
  1412. #define SQL_DRIVER_PROMPT 2
  1413. #define SQL_DRIVER_COMPLETE_REQUIRED 3
  1414. #ifndef RC_INVOKED
  1415. SQLRETURN SQL_API SQLDriverConnect(
  1416. SQLHDBC hdbc,
  1417. SQLHWND hwnd,
  1418. SQLCHAR *szConnStrIn,
  1419. SQLSMALLINT cbConnStrIn,
  1420. SQLCHAR *szConnStrOut,
  1421. SQLSMALLINT cbConnStrOutMax,
  1422. SQLSMALLINT *pcbConnStrOut,
  1423. SQLUSMALLINT fDriverCompletion)
  1424. {return 0;}
  1425. #endif /* RC_INVOKED */
  1426. /* Level 2 Functions */
  1427. /* SQLExtendedFetch "fFetchType" values */
  1428. #define SQL_FETCH_BOOKMARK 8
  1429. /* SQLExtendedFetch "rgfRowStatus" element values */
  1430. #define SQL_ROW_SUCCESS 0
  1431. #define SQL_ROW_DELETED 1
  1432. #define SQL_ROW_UPDATED 2
  1433. #define SQL_ROW_NOROW 3
  1434. #define SQL_ROW_ADDED 4
  1435. #define SQL_ROW_ERROR 5
  1436. #if (ODBCVER >= 0x0300)
  1437. #define SQL_ROW_SUCCESS_WITH_INFO 6
  1438. #define SQL_ROW_PROCEED 0
  1439. #define SQL_ROW_IGNORE 1
  1440. #endif
  1441. /* value for SQL_DESC_ARRAY_STATUS_PTR */
  1442. #if (ODBCVER >= 0x0300)
  1443. #define SQL_PARAM_SUCCESS 0
  1444. #define SQL_PARAM_SUCCESS_WITH_INFO 6
  1445. #define SQL_PARAM_ERROR 5
  1446. #define SQL_PARAM_UNUSED 7
  1447. #define SQL_PARAM_DIAG_UNAVAILABLE 1
  1448. #define SQL_PARAM_PROCEED 0
  1449. #define SQL_PARAM_IGNORE 1
  1450. #endif /* ODBCVER >= 0x0300 */
  1451. /* Defines for SQLForeignKeys (UPDATE_RULE and DELETE_RULE) */
  1452. #define SQL_CASCADE 0
  1453. #define SQL_RESTRICT 1
  1454. #define SQL_SET_NULL 2
  1455. #if (ODBCVER >= 0x0250)
  1456. #define SQL_NO_ACTION 3
  1457. #define SQL_SET_DEFAULT 4
  1458. #endif /* ODBCVER >= 0x0250 */
  1459. #if (ODBCVER >= 0x0300)
  1460. /* Note that the following are in a different column of SQLForeignKeys than */
  1461. /* the previous #defines. These are for DEFERRABILITY. */
  1462. #define SQL_INITIALLY_DEFERRED 5
  1463. #define SQL_INITIALLY_IMMEDIATE 6
  1464. #define SQL_NOT_DEFERRABLE 7
  1465. #endif /* ODBCVER >= 0x0300 */
  1466. /* Defines for SQLBindParameter and
  1467. SQLProcedureColumns (returned in the result set) */
  1468. #define SQL_PARAM_TYPE_UNKNOWN 0
  1469. #define SQL_PARAM_INPUT 1
  1470. #define SQL_PARAM_INPUT_OUTPUT 2
  1471. #define SQL_RESULT_COL 3
  1472. #define SQL_PARAM_OUTPUT 4
  1473. #define SQL_RETURN_VALUE 5
  1474. /* Defines for SQLProcedures (returned in the result set) */
  1475. #define SQL_PT_UNKNOWN 0
  1476. #define SQL_PT_PROCEDURE 1
  1477. #define SQL_PT_FUNCTION 2
  1478. #ifndef RC_INVOKED
  1479. /* This define is too large for RC */
  1480. #define SQL_ODBC_KEYWORDS \
  1481. "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\
  1482. "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\
  1483. "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\
  1484. "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\
  1485. "COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\
  1486. "CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\
  1487. "CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\
  1488. "DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\
  1489. "DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\
  1490. "DISTINCT,DOMAIN,DOUBLE,DROP,"\
  1491. "ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\
  1492. "EXISTS,EXTERNAL,EXTRACT,"\
  1493. "FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\
  1494. "GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\
  1495. "IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\
  1496. "INPUT,INSENSITIVE,INSERT,INT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\
  1497. "JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\
  1498. "MATCH,MAX,MIN,MINUTE,MODULE,MONTH,"\
  1499. "NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\
  1500. "OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\
  1501. "PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\
  1502. "PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\
  1503. "READ,REAL,REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS"\
  1504. "SCHEMA,SCROLL,SECOND,SECTION,SELECT,SESSION,SESSION_USER,SET,SIZE,"\
  1505. "SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\
  1506. "SUBSTRING,SUM,SYSTEM_USER,"\
  1507. "TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\
  1508. "TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\
  1509. "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\
  1510. "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\
  1511. "YEAR,ZONE"
  1512. SQLRETURN SQL_API SQLBrowseConnect(
  1513. SQLHDBC hdbc,
  1514. SQLCHAR *szConnStrIn,
  1515. SQLSMALLINT cbConnStrIn,
  1516. SQLCHAR *szConnStrOut,
  1517. SQLSMALLINT cbConnStrOutMax,
  1518. SQLSMALLINT *pcbConnStrOut)
  1519. {return 0;}
  1520. #if (ODBCVER >= 0x0300)
  1521. SQLRETURN SQL_API SQLBulkOperations(
  1522. SQLHSTMT StatementHandle,
  1523. SQLSMALLINT Operation)
  1524. {return 0;}
  1525. #endif /* ODBCVER >= 0x0300 */
  1526. SQLRETURN SQL_API SQLColAttributes(
  1527. SQLHSTMT hstmt,
  1528. SQLUSMALLINT icol,
  1529. SQLUSMALLINT fDescType,
  1530. SQLPOINTER rgbDesc,
  1531. SQLSMALLINT cbDescMax,
  1532. SQLSMALLINT *pcbDesc,
  1533. SQLLEN * pfDesc)
  1534. {return 0;}
  1535. SQLRETURN SQL_API SQLColumnPrivileges(
  1536. SQLHSTMT hstmt,
  1537. SQLCHAR *szCatalogName,
  1538. SQLSMALLINT cbCatalogName,
  1539. SQLCHAR *szSchemaName,
  1540. SQLSMALLINT cbSchemaName,
  1541. SQLCHAR *szTableName,
  1542. SQLSMALLINT cbTableName,
  1543. SQLCHAR *szColumnName,
  1544. SQLSMALLINT cbColumnName)
  1545. {return 0;}
  1546. SQLRETURN SQL_API SQLDescribeParam(
  1547. SQLHSTMT hstmt,
  1548. SQLUSMALLINT ipar,
  1549. SQLSMALLINT *pfSqlType,
  1550. SQLULEN *pcbParamDef,
  1551. SQLSMALLINT *pibScale,
  1552. SQLSMALLINT *pfNullable)
  1553. {return 0;}
  1554. SQLRETURN SQL_API SQLExtendedFetch(
  1555. SQLHSTMT hstmt,
  1556. SQLUSMALLINT fFetchType,
  1557. SQLROWOFFSET irow,
  1558. SQLROWSETSIZE *pcrow,
  1559. SQLUSMALLINT *rgfRowStatus)
  1560. {return 0;}
  1561. SQLRETURN SQL_API SQLForeignKeys(
  1562. SQLHSTMT hstmt,
  1563. SQLCHAR *szPkCatalogName,
  1564. SQLSMALLINT cbPkCatalogName,
  1565. SQLCHAR *szPkSchemaName,
  1566. SQLSMALLINT cbPkSchemaName,
  1567. SQLCHAR *szPkTableName,
  1568. SQLSMALLINT cbPkTableName,
  1569. SQLCHAR *szFkCatalogName,
  1570. SQLSMALLINT cbFkCatalogName,
  1571. SQLCHAR *szFkSchemaName,
  1572. SQLSMALLINT cbFkSchemaName,
  1573. SQLCHAR *szFkTableName,
  1574. SQLSMALLINT cbFkTableName)
  1575. {return 0;}
  1576. SQLRETURN SQL_API SQLMoreResults(
  1577. SQLHSTMT hstmt)
  1578. {return 0;}
  1579. SQLRETURN SQL_API SQLNativeSql(
  1580. SQLHDBC hdbc,
  1581. SQLCHAR *szSqlStrIn,
  1582. SQLINTEGER cbSqlStrIn,
  1583. SQLCHAR *szSqlStr,
  1584. SQLINTEGER cbSqlStrMax,
  1585. SQLINTEGER *pcbSqlStr)
  1586. {return 0;}
  1587. SQLRETURN SQL_API SQLNumParams(
  1588. SQLHSTMT hstmt,
  1589. SQLSMALLINT *pcpar)
  1590. {return 0;}
  1591. SQLRETURN SQL_API SQLParamOptions(
  1592. SQLHSTMT hstmt,
  1593. SQLROWSETSIZE crow,
  1594. SQLROWSETSIZE *pirow)
  1595. {return 0;}
  1596. SQLRETURN SQL_API SQLPrimaryKeys(
  1597. SQLHSTMT hstmt,
  1598. SQLCHAR *szCatalogName,
  1599. SQLSMALLINT cbCatalogName,
  1600. SQLCHAR *szSchemaName,
  1601. SQLSMALLINT cbSchemaName,
  1602. SQLCHAR *szTableName,
  1603. SQLSMALLINT cbTableName)
  1604. {return 0;}
  1605. SQLRETURN SQL_API SQLProcedureColumns(
  1606. SQLHSTMT hstmt,
  1607. SQLCHAR *szCatalogName,
  1608. SQLSMALLINT cbCatalogName,
  1609. SQLCHAR *szSchemaName,
  1610. SQLSMALLINT cbSchemaName,
  1611. SQLCHAR *szProcName,
  1612. SQLSMALLINT cbProcName,
  1613. SQLCHAR *szColumnName,
  1614. SQLSMALLINT cbColumnName)
  1615. {return 0;}
  1616. SQLRETURN SQL_API SQLProcedures(
  1617. SQLHSTMT hstmt,
  1618. SQLCHAR *szCatalogName,
  1619. SQLSMALLINT cbCatalogName,
  1620. SQLCHAR *szSchemaName,
  1621. SQLSMALLINT cbSchemaName,
  1622. SQLCHAR *szProcName,
  1623. SQLSMALLINT cbProcName)
  1624. {return 0;}
  1625. SQLRETURN SQL_API SQLSetPos(
  1626. SQLHSTMT hstmt,
  1627. SQLSETPOSIROW irow,
  1628. SQLUSMALLINT fOption,
  1629. SQLUSMALLINT fLock)
  1630. {return 0;}
  1631. SQLRETURN SQL_API SQLTablePrivileges(
  1632. SQLHSTMT hstmt,
  1633. SQLCHAR *szCatalogName,
  1634. SQLSMALLINT cbCatalogName,
  1635. SQLCHAR *szSchemaName,
  1636. SQLSMALLINT cbSchemaName,
  1637. SQLCHAR *szTableName,
  1638. SQLSMALLINT cbTableName)
  1639. {return 0;}
  1640. SQLRETURN SQL_API SQLDrivers(
  1641. SQLHENV henv,
  1642. SQLUSMALLINT fDirection,
  1643. SQLCHAR *szDriverDesc,
  1644. SQLSMALLINT cbDriverDescMax,
  1645. SQLSMALLINT *pcbDriverDesc,
  1646. SQLCHAR *szDriverAttributes,
  1647. SQLSMALLINT cbDrvrAttrMax,
  1648. SQLSMALLINT *pcbDrvrAttr)
  1649. {return 0;}
  1650. SQLRETURN SQL_API SQLBindParameter(
  1651. SQLHSTMT hstmt,
  1652. SQLUSMALLINT ipar,
  1653. SQLSMALLINT fParamType,
  1654. SQLSMALLINT fCType,
  1655. SQLSMALLINT fSqlType,
  1656. SQLULEN cbColDef,
  1657. SQLSMALLINT ibScale,
  1658. SQLPOINTER rgbValue,
  1659. SQLLEN cbValueMax,
  1660. SQLLEN *pcbValue)
  1661. {return 0;}
  1662. #endif /* RC_INVOKED */
  1663. /*---------------------------------------------------------*/
  1664. /* SQLAllocHandleStd is implemented to make SQLAllocHandle */
  1665. /* compatible with X/Open standard. an application should */
  1666. /* not call SQLAllocHandleStd directly */
  1667. /*---------------------------------------------------------*/
  1668. #ifdef ODBC_STD
  1669. #define SQLAllocHandle SQLAllocHandleStd
  1670. #define SQLAllocEnv(phenv) SQLAllocHandleStd(SQL_HANDLE_ENV, SQL_NULL_HANDLE, phenv)
  1671. /* Internal type subcodes */
  1672. #define SQL_YEAR SQL_CODE_YEAR
  1673. #define SQL_MONTH SQL_CODE_MONTH
  1674. #define SQL_DAY SQL_CODE_DAY
  1675. #define SQL_HOUR SQL_CODE_HOUR
  1676. #define SQL_MINUTE SQL_CODE_MINUTE
  1677. #define SQL_SECOND SQL_CODE_SECOND
  1678. #define SQL_YEAR_TO_MONTH SQL_CODE_YEAR_TO_MONTH
  1679. #define SQL_DAY_TO_HOUR SQL_CODE_DAY_TO_HOUR
  1680. #define SQL_DAY_TO_MINUTE SQL_CODE_DAY_TO_MINUTE
  1681. #define SQL_DAY_TO_SECOND SQL_CODE_DAY_TO_SECOND
  1682. #define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE
  1683. #define SQL_HOUR_TO_SECOND SQL_CODE_HOUR_TO_SECOND
  1684. #define SQL_MINUTE_TO_SECOND SQL_CODE_MINUTE_TO_SECOND
  1685. #endif /* ODBC_STD */
  1686. #if (ODBCVER >= 0x0300)
  1687. #ifndef RC_INVOKED
  1688. SQLRETURN SQL_API SQLAllocHandleStd(
  1689. SQLSMALLINT fHandleType,
  1690. SQLHANDLE hInput,
  1691. SQLHANDLE *phOutput)
  1692. {return 0;}
  1693. #endif /* RC_INVOKED */
  1694. #endif
  1695. /* Deprecated defines from prior versions of ODBC */
  1696. #define SQL_DATABASE_NAME 16 /* Use SQLGetConnectOption/SQL_CURRENT_QUALIFIER */
  1697. #define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR
  1698. #define SQL_FETCH_PREV SQL_FETCH_PRIOR
  1699. #define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER
  1700. #define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER
  1701. #define SQL_CC_DELETE SQL_CB_DELETE
  1702. #define SQL_CR_DELETE SQL_CB_DELETE
  1703. #define SQL_CC_CLOSE SQL_CB_CLOSE
  1704. #define SQL_CR_CLOSE SQL_CB_CLOSE
  1705. #define SQL_CC_PRESERVE SQL_CB_PRESERVE
  1706. #define SQL_CR_PRESERVE SQL_CB_PRESERVE
  1707. /* SQL_FETCH_RESUME is not supported by 2.0+ drivers
  1708. #define SQL_FETCH_RESUME 7
  1709. */
  1710. #define SQL_SCROLL_FORWARD_ONLY 0L /*-SQL_CURSOR_FORWARD_ONLY */
  1711. #define SQL_SCROLL_KEYSET_DRIVEN (-1L) /*-SQL_CURSOR_KEYSET_DRIVEN */
  1712. #define SQL_SCROLL_DYNAMIC (-2L) /*-SQL_CURSOR_DYNAMIC */
  1713. #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */
  1714. /* Deprecated functions from prior versions of ODBC */
  1715. #ifndef RC_INVOKED
  1716. SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */
  1717. SQLHSTMT hstmt,
  1718. SQLUSMALLINT fConcurrency,
  1719. SQLLEN crowKeyset,
  1720. SQLUSMALLINT crowRowset)
  1721. {return 0;}
  1722. /* Tracing section */
  1723. #define TRACE_VERSION 1000 /* Version of trace API */
  1724. RETCODE SQL_API TraceOpenLogFile(LPWSTR,LPWSTR,DWORD)
  1725. {return 0;}
  1726. RETCODE SQL_API TraceCloseLogFile()
  1727. {return 0;}
  1728. VOID SQL_API TraceReturn(RETCODE,RETCODE)
  1729. {return;}
  1730. DWORD SQL_API TraceVersion()
  1731. {return 0;}
  1732. /* Functions for Visual Studio Analyzer*/
  1733. /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */
  1734. #define TRACE_ON 0x00000001L
  1735. #define TRACE_VS_EVENT_ON 0x00000002L
  1736. RETCODE SQL_API TraceVSControl(DWORD)
  1737. {return 0;}
  1738. /* Functions for setting the connection pooling failure detection code */
  1739. /* The "TryWait" value is the time (in seconds) that the DM will wait */
  1740. /* between detecting that a connection is dead (using */
  1741. /* SQL_ATTR_CONNECTION_DEAD) and retrying the connection. During that */
  1742. /* interval, connection requests will get "The server appears to be */
  1743. /* dead" error returns. */
  1744. BOOL SQL_API ODBCSetTryWaitValue(DWORD dwValue)
  1745. {return 0;}
  1746. DWORD SQL_API ODBCGetTryWaitValue()
  1747. {return 0;}
  1748. /* the flags in ODBC_VS_ARGS */
  1749. #define ODBC_VS_FLAG_UNICODE_ARG 0x00000001L /* the argument is unicode */
  1750. #define ODBC_VS_FLAG_UNICODE_COR 0x00000002L /* the correlation is unicode */
  1751. #define ODBC_VS_FLAG_RETCODE 0x00000004L /* RetCode field is set */
  1752. #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */
  1753. typedef struct tagODBC_VS_ARGS {
  1754. const GUID *pguidEvent; /* the GUID for event */
  1755. DWORD dwFlags; /* flags for the call */
  1756. union {
  1757. WCHAR *wszArg;
  1758. CHAR *szArg;
  1759. };
  1760. union {
  1761. WCHAR *wszCorrelation;
  1762. CHAR *szCorrelation;
  1763. };
  1764. RETCODE RetCode;
  1765. } ODBC_VS_ARGS, *PODBC_VS_ARGS;
  1766. VOID SQL_API FireVSDebugEvent(PODBC_VS_ARGS)
  1767. {return;}
  1768. #endif /* RC_INVOKED */
  1769. #ifdef __cplusplus
  1770. } /* End of extern "C" { */
  1771. #endif /* __cplusplus */