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.

935 lines
29 KiB

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