sql.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef __SQL
  7. #define __SQL
  8. #ifndef ODBCVER
  9. #define ODBCVER 0x0351
  10. #endif
  11. #include <sqltypes.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #define SQL_NULL_DATA (-1)
  16. #define SQL_DATA_AT_EXEC (-2)
  17. #define SQL_SUCCESS 0
  18. #define SQL_SUCCESS_WITH_INFO 1
  19. #if (ODBCVER >= 0x0300)
  20. #define SQL_NO_DATA 100
  21. #endif
  22. #define SQL_ERROR (-1)
  23. #define SQL_INVALID_HANDLE (-2)
  24. #define SQL_STILL_EXECUTING 2
  25. #define SQL_NEED_DATA 99
  26. #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
  27. #define SQL_NTS (-3)
  28. #define SQL_NTSL (__MSABI_LONG(-3))
  29. #define SQL_MAX_MESSAGE_LENGTH 512
  30. #if (ODBCVER >= 0x0300)
  31. #define SQL_DATE_LEN 10
  32. #define SQL_TIME_LEN 8
  33. #define SQL_TIMESTAMP_LEN 19
  34. #endif
  35. #if (ODBCVER >= 0x0300)
  36. #define SQL_HANDLE_ENV 1
  37. #define SQL_HANDLE_DBC 2
  38. #define SQL_HANDLE_STMT 3
  39. #define SQL_HANDLE_DESC 4
  40. #endif
  41. #if (ODBCVER >= 0x0300)
  42. #define SQL_ATTR_OUTPUT_NTS 10001
  43. #endif
  44. #if (ODBCVER >= 0x0300)
  45. #define SQL_ATTR_AUTO_IPD 10001
  46. #define SQL_ATTR_METADATA_ID 10014
  47. #endif
  48. #if (ODBCVER >= 0x0300)
  49. #define SQL_ATTR_APP_ROW_DESC 10010
  50. #define SQL_ATTR_APP_PARAM_DESC 10011
  51. #define SQL_ATTR_IMP_ROW_DESC 10012
  52. #define SQL_ATTR_IMP_PARAM_DESC 10013
  53. #define SQL_ATTR_CURSOR_SCROLLABLE (-1)
  54. #define SQL_ATTR_CURSOR_SENSITIVITY (-2)
  55. #endif
  56. #if (ODBCVER >= 0x0300)
  57. #define SQL_NONSCROLLABLE 0
  58. #define SQL_SCROLLABLE 1
  59. #endif
  60. #if (ODBCVER >= 0x0300)
  61. #define SQL_DESC_COUNT 1001
  62. #define SQL_DESC_TYPE 1002
  63. #define SQL_DESC_LENGTH 1003
  64. #define SQL_DESC_OCTET_LENGTH_PTR 1004
  65. #define SQL_DESC_PRECISION 1005
  66. #define SQL_DESC_SCALE 1006
  67. #define SQL_DESC_DATETIME_INTERVAL_CODE 1007
  68. #define SQL_DESC_NULLABLE 1008
  69. #define SQL_DESC_INDICATOR_PTR 1009
  70. #define SQL_DESC_DATA_PTR 1010
  71. #define SQL_DESC_NAME 1011
  72. #define SQL_DESC_UNNAMED 1012
  73. #define SQL_DESC_OCTET_LENGTH 1013
  74. #define SQL_DESC_ALLOC_TYPE 1099
  75. #endif
  76. #if (ODBCVER >= 0x0300)
  77. #define SQL_DIAG_RETURNCODE 1
  78. #define SQL_DIAG_NUMBER 2
  79. #define SQL_DIAG_ROW_COUNT 3
  80. #define SQL_DIAG_SQLSTATE 4
  81. #define SQL_DIAG_NATIVE 5
  82. #define SQL_DIAG_MESSAGE_TEXT 6
  83. #define SQL_DIAG_DYNAMIC_FUNCTION 7
  84. #define SQL_DIAG_CLASS_ORIGIN 8
  85. #define SQL_DIAG_SUBCLASS_ORIGIN 9
  86. #define SQL_DIAG_CONNECTION_NAME 10
  87. #define SQL_DIAG_SERVER_NAME 11
  88. #define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12
  89. #endif
  90. #if (ODBCVER >= 0x0300)
  91. #define SQL_DIAG_ALTER_DOMAIN 3
  92. #define SQL_DIAG_ALTER_TABLE 4
  93. #define SQL_DIAG_CALL 7
  94. #define SQL_DIAG_CREATE_ASSERTION 6
  95. #define SQL_DIAG_CREATE_CHARACTER_SET 8
  96. #define SQL_DIAG_CREATE_COLLATION 10
  97. #define SQL_DIAG_CREATE_DOMAIN 23
  98. #define SQL_DIAG_CREATE_INDEX (-1)
  99. #define SQL_DIAG_CREATE_SCHEMA 64
  100. #define SQL_DIAG_CREATE_TABLE 77
  101. #define SQL_DIAG_CREATE_TRANSLATION 79
  102. #define SQL_DIAG_CREATE_VIEW 84
  103. #define SQL_DIAG_DELETE_WHERE 19
  104. #define SQL_DIAG_DROP_ASSERTION 24
  105. #define SQL_DIAG_DROP_CHARACTER_SET 25
  106. #define SQL_DIAG_DROP_COLLATION 26
  107. #define SQL_DIAG_DROP_DOMAIN 27
  108. #define SQL_DIAG_DROP_INDEX (-2)
  109. #define SQL_DIAG_DROP_SCHEMA 31
  110. #define SQL_DIAG_DROP_TABLE 32
  111. #define SQL_DIAG_DROP_TRANSLATION 33
  112. #define SQL_DIAG_DROP_VIEW 36
  113. #define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38
  114. #define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81
  115. #define SQL_DIAG_GRANT 48
  116. #define SQL_DIAG_INSERT 50
  117. #define SQL_DIAG_REVOKE 59
  118. #define SQL_DIAG_SELECT_CURSOR 85
  119. #define SQL_DIAG_UNKNOWN_STATEMENT 0
  120. #define SQL_DIAG_UPDATE_WHERE 82
  121. #endif
  122. #define SQL_UNKNOWN_TYPE 0
  123. #define SQL_CHAR 1
  124. #define SQL_NUMERIC 2
  125. #define SQL_DECIMAL 3
  126. #define SQL_INTEGER 4
  127. #define SQL_SMALLINT 5
  128. #define SQL_FLOAT 6
  129. #define SQL_REAL 7
  130. #define SQL_DOUBLE 8
  131. #if (ODBCVER >= 0x0300)
  132. #define SQL_DATETIME 9
  133. #endif
  134. #define SQL_VARCHAR 12
  135. #if (ODBCVER >= 0x0300)
  136. #define SQL_TYPE_DATE 91
  137. #define SQL_TYPE_TIME 92
  138. #define SQL_TYPE_TIMESTAMP 93
  139. #endif
  140. #if (ODBCVER >= 0x0300)
  141. #define SQL_UNSPECIFIED 0
  142. #define SQL_INSENSITIVE 1
  143. #define SQL_SENSITIVE 2
  144. #endif
  145. #define SQL_ALL_TYPES 0
  146. #if (ODBCVER >= 0x0300)
  147. #define SQL_DEFAULT 99
  148. #endif
  149. #if (ODBCVER >= 0x0300)
  150. #define SQL_ARD_TYPE (-99)
  151. #endif
  152. #if (ODBCVER >= 0x0300)
  153. #define SQL_CODE_DATE 1
  154. #define SQL_CODE_TIME 2
  155. #define SQL_CODE_TIMESTAMP 3
  156. #endif
  157. #if (ODBCVER >= 0x0300)
  158. #define SQL_FALSE 0
  159. #define SQL_TRUE 1
  160. #endif
  161. #define SQL_NO_NULLS 0
  162. #define SQL_NULLABLE 1
  163. #define SQL_NULLABLE_UNKNOWN 2
  164. #if (ODBCVER >= 0x0300)
  165. #define SQL_PRED_NONE 0
  166. #define SQL_PRED_CHAR 1
  167. #define SQL_PRED_BASIC 2
  168. #endif
  169. #if (ODBCVER >= 0x0300)
  170. #define SQL_NAMED 0
  171. #define SQL_UNNAMED 1
  172. #endif
  173. #if (ODBCVER >= 0x0300)
  174. #define SQL_DESC_ALLOC_AUTO 1
  175. #define SQL_DESC_ALLOC_USER 2
  176. #endif
  177. #define SQL_CLOSE 0
  178. #define SQL_DROP 1
  179. #define SQL_UNBIND 2
  180. #define SQL_RESET_PARAMS 3
  181. #define SQL_FETCH_NEXT 1
  182. #define SQL_FETCH_FIRST 2
  183. #define SQL_FETCH_LAST 3
  184. #define SQL_FETCH_PRIOR 4
  185. #define SQL_FETCH_ABSOLUTE 5
  186. #define SQL_FETCH_RELATIVE 6
  187. #define SQL_COMMIT 0
  188. #define SQL_ROLLBACK 1
  189. #define SQL_NULL_HENV 0
  190. #define SQL_NULL_HDBC 0
  191. #define SQL_NULL_HSTMT 0
  192. #if (ODBCVER >= 0x0300)
  193. #define SQL_NULL_HDESC 0
  194. #endif
  195. #if (ODBCVER >= 0x0300)
  196. #define SQL_NULL_HANDLE __MSABI_LONG(0)
  197. #endif
  198. #define SQL_SCOPE_CURROW 0
  199. #define SQL_SCOPE_TRANSACTION 1
  200. #define SQL_SCOPE_SESSION 2
  201. #define SQL_PC_UNKNOWN 0
  202. #if (ODBCVER >= 0x0300)
  203. #define SQL_PC_NON_PSEUDO 1
  204. #endif
  205. #define SQL_PC_PSEUDO 2
  206. #if (ODBCVER >= 0x0300)
  207. #define SQL_ROW_IDENTIFIER 1
  208. #endif
  209. #define SQL_INDEX_UNIQUE 0
  210. #define SQL_INDEX_ALL 1
  211. #define SQL_INDEX_CLUSTERED 1
  212. #define SQL_INDEX_HASHED 2
  213. #define SQL_INDEX_OTHER 3
  214. #define SQL_API_SQLALLOCCONNECT 1
  215. #define SQL_API_SQLALLOCENV 2
  216. #if (ODBCVER >= 0x0300)
  217. #define SQL_API_SQLALLOCHANDLE 1001
  218. #endif
  219. #define SQL_API_SQLALLOCSTMT 3
  220. #define SQL_API_SQLBINDCOL 4
  221. #if (ODBCVER >= 0x0300)
  222. #define SQL_API_SQLBINDPARAM 1002
  223. #endif
  224. #define SQL_API_SQLCANCEL 5
  225. #if (ODBCVER >= 0x0300)
  226. #define SQL_API_SQLCLOSECURSOR 1003
  227. #define SQL_API_SQLCOLATTRIBUTE 6
  228. #endif
  229. #define SQL_API_SQLCOLUMNS 40
  230. #define SQL_API_SQLCONNECT 7
  231. #if (ODBCVER >= 0x0300)
  232. #define SQL_API_SQLCOPYDESC 1004
  233. #endif
  234. #define SQL_API_SQLDATASOURCES 57
  235. #define SQL_API_SQLDESCRIBECOL 8
  236. #define SQL_API_SQLDISCONNECT 9
  237. #if (ODBCVER >= 0x0300)
  238. #define SQL_API_SQLENDTRAN 1005
  239. #endif
  240. #define SQL_API_SQLERROR 10
  241. #define SQL_API_SQLEXECDIRECT 11
  242. #define SQL_API_SQLEXECUTE 12
  243. #define SQL_API_SQLFETCH 13
  244. #if (ODBCVER >= 0x0300)
  245. #define SQL_API_SQLFETCHSCROLL 1021
  246. #endif
  247. #define SQL_API_SQLFREECONNECT 14
  248. #define SQL_API_SQLFREEENV 15
  249. #if (ODBCVER >= 0x0300)
  250. #define SQL_API_SQLFREEHANDLE 1006
  251. #endif
  252. #define SQL_API_SQLFREESTMT 16
  253. #if (ODBCVER >= 0x0300)
  254. #define SQL_API_SQLGETCONNECTATTR 1007
  255. #endif
  256. #define SQL_API_SQLGETCONNECTOPTION 42
  257. #define SQL_API_SQLGETCURSORNAME 17
  258. #define SQL_API_SQLGETDATA 43
  259. #if (ODBCVER >= 0x0300)
  260. #define SQL_API_SQLGETDESCFIELD 1008
  261. #define SQL_API_SQLGETDESCREC 1009
  262. #define SQL_API_SQLGETDIAGFIELD 1010
  263. #define SQL_API_SQLGETDIAGREC 1011
  264. #define SQL_API_SQLGETENVATTR 1012
  265. #endif
  266. #define SQL_API_SQLGETFUNCTIONS 44
  267. #define SQL_API_SQLGETINFO 45
  268. #if (ODBCVER >= 0x0300)
  269. #define SQL_API_SQLGETSTMTATTR 1014
  270. #endif
  271. #define SQL_API_SQLGETSTMTOPTION 46
  272. #define SQL_API_SQLGETTYPEINFO 47
  273. #define SQL_API_SQLNUMRESULTCOLS 18
  274. #define SQL_API_SQLPARAMDATA 48
  275. #define SQL_API_SQLPREPARE 19
  276. #define SQL_API_SQLPUTDATA 49
  277. #define SQL_API_SQLROWCOUNT 20
  278. #if (ODBCVER >= 0x0300)
  279. #define SQL_API_SQLSETCONNECTATTR 1016
  280. #endif
  281. #define SQL_API_SQLSETCONNECTOPTION 50
  282. #define SQL_API_SQLSETCURSORNAME 21
  283. #if (ODBCVER >= 0x0300)
  284. #define SQL_API_SQLSETDESCFIELD 1017
  285. #define SQL_API_SQLSETDESCREC 1018
  286. #define SQL_API_SQLSETENVATTR 1019
  287. #endif
  288. #define SQL_API_SQLSETPARAM 22
  289. #if (ODBCVER >= 0x0300)
  290. #define SQL_API_SQLSETSTMTATTR 1020
  291. #endif
  292. #define SQL_API_SQLSETSTMTOPTION 51
  293. #define SQL_API_SQLSPECIALCOLUMNS 52
  294. #define SQL_API_SQLSTATISTICS 53
  295. #define SQL_API_SQLTABLES 54
  296. #define SQL_API_SQLTRANSACT 23
  297. #if (ODBCVER >= 0x0300)
  298. #define SQL_MAX_DRIVER_CONNECTIONS 0
  299. #define SQL_MAXIMUM_DRIVER_CONNECTIONS SQL_MAX_DRIVER_CONNECTIONS
  300. #define SQL_MAX_CONCURRENT_ACTIVITIES 1
  301. #define SQL_MAXIMUM_CONCURRENT_ACTIVITIES SQL_MAX_CONCURRENT_ACTIVITIES
  302. #endif
  303. #define SQL_DATA_SOURCE_NAME 2
  304. #define SQL_FETCH_DIRECTION 8
  305. #define SQL_SERVER_NAME 13
  306. #define SQL_SEARCH_PATTERN_ESCAPE 14
  307. #define SQL_DBMS_NAME 17
  308. #define SQL_DBMS_VER 18
  309. #define SQL_ACCESSIBLE_TABLES 19
  310. #define SQL_ACCESSIBLE_PROCEDURES 20
  311. #define SQL_CURSOR_COMMIT_BEHAVIOR 23
  312. #define SQL_DATA_SOURCE_READ_ONLY 25
  313. #define SQL_DEFAULT_TXN_ISOLATION 26
  314. #define SQL_IDENTIFIER_CASE 28
  315. #define SQL_IDENTIFIER_QUOTE_CHAR 29
  316. #define SQL_MAX_COLUMN_NAME_LEN 30
  317. #define SQL_MAXIMUM_COLUMN_NAME_LENGTH SQL_MAX_COLUMN_NAME_LEN
  318. #define SQL_MAX_CURSOR_NAME_LEN 31
  319. #define SQL_MAXIMUM_CURSOR_NAME_LENGTH SQL_MAX_CURSOR_NAME_LEN
  320. #define SQL_MAX_SCHEMA_NAME_LEN 32
  321. #define SQL_MAXIMUM_SCHEMA_NAME_LENGTH SQL_MAX_SCHEMA_NAME_LEN
  322. #define SQL_MAX_CATALOG_NAME_LEN 34
  323. #define SQL_MAXIMUM_CATALOG_NAME_LENGTH SQL_MAX_CATALOG_NAME_LEN
  324. #define SQL_MAX_TABLE_NAME_LEN 35
  325. #define SQL_SCROLL_CONCURRENCY 43
  326. #define SQL_TXN_CAPABLE 46
  327. #define SQL_TRANSACTION_CAPABLE SQL_TXN_CAPABLE
  328. #define SQL_USER_NAME 47
  329. #define SQL_TXN_ISOLATION_OPTION 72
  330. #define SQL_TRANSACTION_ISOLATION_OPTION SQL_TXN_ISOLATION_OPTION
  331. #define SQL_INTEGRITY 73
  332. #define SQL_GETDATA_EXTENSIONS 81
  333. #define SQL_NULL_COLLATION 85
  334. #define SQL_ALTER_TABLE 86
  335. #define SQL_ORDER_BY_COLUMNS_IN_SELECT 90
  336. #define SQL_SPECIAL_CHARACTERS 94
  337. #define SQL_MAX_COLUMNS_IN_GROUP_BY 97
  338. #define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY SQL_MAX_COLUMNS_IN_GROUP_BY
  339. #define SQL_MAX_COLUMNS_IN_INDEX 98
  340. #define SQL_MAXIMUM_COLUMNS_IN_INDEX SQL_MAX_COLUMNS_IN_INDEX
  341. #define SQL_MAX_COLUMNS_IN_ORDER_BY 99
  342. #define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY SQL_MAX_COLUMNS_IN_ORDER_BY
  343. #define SQL_MAX_COLUMNS_IN_SELECT 100
  344. #define SQL_MAXIMUM_COLUMNS_IN_SELECT SQL_MAX_COLUMNS_IN_SELECT
  345. #define SQL_MAX_COLUMNS_IN_TABLE 101
  346. #define SQL_MAX_INDEX_SIZE 102
  347. #define SQL_MAXIMUM_INDEX_SIZE SQL_MAX_INDEX_SIZE
  348. #define SQL_MAX_ROW_SIZE 104
  349. #define SQL_MAXIMUM_ROW_SIZE SQL_MAX_ROW_SIZE
  350. #define SQL_MAX_STATEMENT_LEN 105
  351. #define SQL_MAXIMUM_STATEMENT_LENGTH SQL_MAX_STATEMENT_LEN
  352. #define SQL_MAX_TABLES_IN_SELECT 106
  353. #define SQL_MAXIMUM_TABLES_IN_SELECT SQL_MAX_TABLES_IN_SELECT
  354. #define SQL_MAX_USER_NAME_LEN 107
  355. #define SQL_MAXIMUM_USER_NAME_LENGTH SQL_MAX_USER_NAME_LEN
  356. #if (ODBCVER >= 0x0300)
  357. #define SQL_OJ_CAPABILITIES 115
  358. #define SQL_OUTER_JOIN_CAPABILITIES SQL_OJ_CAPABILITIES
  359. #endif
  360. #if (ODBCVER >= 0x0300)
  361. #define SQL_XOPEN_CLI_YEAR 10000
  362. #define SQL_CURSOR_SENSITIVITY 10001
  363. #define SQL_DESCRIBE_PARAMETER 10002
  364. #define SQL_CATALOG_NAME 10003
  365. #define SQL_COLLATION_SEQ 10004
  366. #define SQL_MAX_IDENTIFIER_LEN 10005
  367. #define SQL_MAXIMUM_IDENTIFIER_LENGTH SQL_MAX_IDENTIFIER_LEN
  368. #endif
  369. #if (ODBCVER >= 0x0200)
  370. #define SQL_AT_ADD_COLUMN __MSABI_LONG(0x00000001)
  371. #define SQL_AT_DROP_COLUMN __MSABI_LONG(0x00000002)
  372. #endif
  373. #if (ODBCVER >= 0x0300)
  374. #define SQL_AT_ADD_CONSTRAINT __MSABI_LONG(0x00000008)
  375. #endif
  376. #if (ODBCVER >= 0x0300)
  377. #define SQL_AM_NONE 0
  378. #define SQL_AM_CONNECTION 1
  379. #define SQL_AM_STATEMENT 2
  380. #endif
  381. #define SQL_CB_DELETE 0
  382. #define SQL_CB_CLOSE 1
  383. #define SQL_CB_PRESERVE 2
  384. #define SQL_FD_FETCH_NEXT __MSABI_LONG(0x00000001)
  385. #define SQL_FD_FETCH_FIRST __MSABI_LONG(0x00000002)
  386. #define SQL_FD_FETCH_LAST __MSABI_LONG(0x00000004)
  387. #define SQL_FD_FETCH_PRIOR __MSABI_LONG(0x00000008)
  388. #define SQL_FD_FETCH_ABSOLUTE __MSABI_LONG(0x00000010)
  389. #define SQL_FD_FETCH_RELATIVE __MSABI_LONG(0x00000020)
  390. #define SQL_GD_ANY_COLUMN __MSABI_LONG(0x00000001)
  391. #define SQL_GD_ANY_ORDER __MSABI_LONG(0x00000002)
  392. #define SQL_IC_UPPER 1
  393. #define SQL_IC_LOWER 2
  394. #define SQL_IC_SENSITIVE 3
  395. #define SQL_IC_MIXED 4
  396. #if (ODBCVER >= 0x0201)
  397. #define SQL_OJ_LEFT __MSABI_LONG(0x00000001)
  398. #define SQL_OJ_RIGHT __MSABI_LONG(0x00000002)
  399. #define SQL_OJ_FULL __MSABI_LONG(0x00000004)
  400. #define SQL_OJ_NESTED __MSABI_LONG(0x00000008)
  401. #define SQL_OJ_NOT_ORDERED __MSABI_LONG(0x00000010)
  402. #define SQL_OJ_INNER __MSABI_LONG(0x00000020)
  403. #define SQL_OJ_ALL_COMPARISON_OPS __MSABI_LONG(0x00000040)
  404. #endif
  405. #define SQL_SCCO_READ_ONLY __MSABI_LONG(0x00000001)
  406. #define SQL_SCCO_LOCK __MSABI_LONG(0x00000002)
  407. #define SQL_SCCO_OPT_ROWVER __MSABI_LONG(0x00000004)
  408. #define SQL_SCCO_OPT_VALUES __MSABI_LONG(0x00000008)
  409. #define SQL_TC_NONE 0
  410. #define SQL_TC_DML 1
  411. #define SQL_TC_ALL 2
  412. #define SQL_TC_DDL_COMMIT 3
  413. #define SQL_TC_DDL_IGNORE 4
  414. #define SQL_TXN_READ_UNCOMMITTED __MSABI_LONG(0x00000001)
  415. #define SQL_TRANSACTION_READ_UNCOMMITTED SQL_TXN_READ_UNCOMMITTED
  416. #define SQL_TXN_READ_COMMITTED __MSABI_LONG(0x00000002)
  417. #define SQL_TRANSACTION_READ_COMMITTED SQL_TXN_READ_COMMITTED
  418. #define SQL_TXN_REPEATABLE_READ __MSABI_LONG(0x00000004)
  419. #define SQL_TRANSACTION_REPEATABLE_READ SQL_TXN_REPEATABLE_READ
  420. #define SQL_TXN_SERIALIZABLE __MSABI_LONG(0x00000008)
  421. #define SQL_TRANSACTION_SERIALIZABLE SQL_TXN_SERIALIZABLE
  422. #define SQL_NC_HIGH 0
  423. #define SQL_NC_LOW 1
  424. #ifndef RC_INVOKED
  425. SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle,SQLHDBC *ConnectionHandle);
  426. SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle);
  427. #if (ODBCVER >= 0x0300)
  428. SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType,SQLHANDLE InputHandle,SQLHANDLE *OutputHandle);
  429. #endif
  430. SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle,SQLHSTMT *StatementHandle);
  431. SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle,SQLUSMALLINT ColumnNumber,SQLSMALLINT TargetType,SQLPOINTER TargetValue,SQLLEN BufferLength,SQLLEN *StrLen_or_Ind);
  432. #if (ODBCVER >= 0x0300)
  433. SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle,SQLUSMALLINT ParameterNumber,SQLSMALLINT ValueType,SQLSMALLINT ParameterType,SQLULEN LengthPrecision,SQLSMALLINT ParameterScale,SQLPOINTER ParameterValue,SQLLEN *StrLen_or_Ind);
  434. #endif
  435. SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle);
  436. #if (ODBCVER >= 0x0300)
  437. SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);
  438. #ifdef _WIN64
  439. SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle,SQLUSMALLINT ColumnNumber,SQLUSMALLINT FieldIdentifier,SQLPOINTER CharacterAttribute,SQLSMALLINT BufferLength,SQLSMALLINT *StringLength,SQLLEN *NumericAttribute);
  440. #else
  441. SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle,SQLUSMALLINT ColumnNumber,SQLUSMALLINT FieldIdentifier,SQLPOINTER CharacterAttribute,SQLSMALLINT BufferLength,SQLSMALLINT *StringLength,SQLPOINTER NumericAttribute);
  442. #endif
  443. #endif
  444. SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle,SQLCHAR *CatalogName,SQLSMALLINT NameLength1,SQLCHAR *SchemaName,SQLSMALLINT NameLength2,SQLCHAR *TableName,SQLSMALLINT NameLength3,SQLCHAR *ColumnName,SQLSMALLINT NameLength4);
  445. SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle,SQLCHAR *ServerName,SQLSMALLINT NameLength1,SQLCHAR *UserName,SQLSMALLINT NameLength2,SQLCHAR *Authentication,SQLSMALLINT NameLength3);
  446. #if (ODBCVER >= 0x0300)
  447. SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle,SQLHDESC TargetDescHandle);
  448. #endif
  449. SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle,SQLUSMALLINT Direction,SQLCHAR *ServerName,SQLSMALLINT BufferLength1,SQLSMALLINT *NameLength1,SQLCHAR *Description,SQLSMALLINT BufferLength2,SQLSMALLINT *NameLength2);
  450. SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle,SQLUSMALLINT ColumnNumber,SQLCHAR *ColumnName,SQLSMALLINT BufferLength,SQLSMALLINT *NameLength,SQLSMALLINT *DataType,SQLULEN *ColumnSize,SQLSMALLINT *DecimalDigits,SQLSMALLINT *Nullable);
  451. SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle);
  452. #if (ODBCVER >= 0x0300)
  453. SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType,SQLHANDLE Handle,SQLSMALLINT CompletionType);
  454. #endif
  455. SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle,SQLHDBC ConnectionHandle,SQLHSTMT StatementHandle,SQLCHAR *Sqlstate,SQLINTEGER *NativeError,SQLCHAR *MessageText,SQLSMALLINT BufferLength,SQLSMALLINT *TextLength);
  456. SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle,SQLCHAR *StatementText,SQLINTEGER TextLength);
  457. SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle);
  458. SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle);
  459. #if (ODBCVER >= 0x0300)
  460. SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle,SQLSMALLINT FetchOrientation,SQLLEN FetchOffset);
  461. #endif
  462. SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle);
  463. SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle);
  464. #if (ODBCVER >= 0x0300)
  465. SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType,SQLHANDLE Handle);
  466. #endif
  467. SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle,SQLUSMALLINT Option);
  468. #if (ODBCVER >= 0x0300)
  469. SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle,SQLINTEGER Attribute,SQLPOINTER Value,SQLINTEGER BufferLength,SQLINTEGER *StringLength);
  470. #endif
  471. SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle,SQLUSMALLINT Option,SQLPOINTER Value);
  472. SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle,SQLCHAR *CursorName,SQLSMALLINT BufferLength,SQLSMALLINT *NameLength);
  473. SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle,SQLUSMALLINT ColumnNumber,SQLSMALLINT TargetType,SQLPOINTER TargetValue,SQLLEN BufferLength,SQLLEN *StrLen_or_Ind);
  474. #if (ODBCVER >= 0x0300)
  475. SQLRETURN SQL_API SQLGetDescField(SQLHDESC DescriptorHandle,SQLSMALLINT RecNumber,SQLSMALLINT FieldIdentifier,SQLPOINTER Value,SQLINTEGER BufferLength,SQLINTEGER *StringLength);
  476. SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle,SQLSMALLINT RecNumber,SQLCHAR *Name,SQLSMALLINT BufferLength,SQLSMALLINT *StringLength,SQLSMALLINT *Type,SQLSMALLINT *SubType,SQLLEN *Length,SQLSMALLINT *Precision,SQLSMALLINT *Scale,SQLSMALLINT *Nullable);
  477. SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType,SQLHANDLE Handle,SQLSMALLINT RecNumber,SQLSMALLINT DiagIdentifier,SQLPOINTER DiagInfo,SQLSMALLINT BufferLength,SQLSMALLINT *StringLength);
  478. SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType,SQLHANDLE Handle,SQLSMALLINT RecNumber,SQLCHAR *Sqlstate,SQLINTEGER *NativeError,SQLCHAR *MessageText,SQLSMALLINT BufferLength,SQLSMALLINT *TextLength);
  479. SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle,SQLINTEGER Attribute,SQLPOINTER Value,SQLINTEGER BufferLength,SQLINTEGER *StringLength);
  480. #endif
  481. SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle,SQLUSMALLINT FunctionId,SQLUSMALLINT *Supported);
  482. SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle,SQLUSMALLINT InfoType,SQLPOINTER InfoValue,SQLSMALLINT BufferLength,SQLSMALLINT *StringLength);
  483. #if (ODBCVER >= 0x0300)
  484. SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle,SQLINTEGER Attribute,SQLPOINTER Value,SQLINTEGER BufferLength,SQLINTEGER *StringLength);
  485. #endif
  486. SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle,SQLUSMALLINT Option,SQLPOINTER Value);
  487. SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle,SQLSMALLINT DataType);
  488. SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle,SQLSMALLINT *ColumnCount);
  489. SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle,SQLPOINTER *Value);
  490. SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle,SQLCHAR *StatementText,SQLINTEGER TextLength);
  491. SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle,SQLPOINTER Data,SQLLEN StrLen_or_Ind);
  492. SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle,SQLLEN *RowCount);
  493. #if (ODBCVER >= 0x0300)
  494. SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle,SQLINTEGER Attribute,SQLPOINTER Value,SQLINTEGER StringLength);
  495. #endif
  496. SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle,SQLUSMALLINT Option,SQLULEN Value);
  497. SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle,SQLCHAR *CursorName,SQLSMALLINT NameLength);
  498. #if (ODBCVER >= 0x0300)
  499. SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle,SQLSMALLINT RecNumber,SQLSMALLINT FieldIdentifier,SQLPOINTER Value,SQLINTEGER BufferLength);
  500. SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle,SQLSMALLINT RecNumber,SQLSMALLINT Type,SQLSMALLINT SubType,SQLLEN Length,SQLSMALLINT Precision,SQLSMALLINT Scale,SQLPOINTER Data,SQLLEN *StringLength,SQLLEN *Indicator);
  501. SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle,SQLINTEGER Attribute,SQLPOINTER Value,SQLINTEGER StringLength);
  502. #endif
  503. SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle,SQLUSMALLINT ParameterNumber,SQLSMALLINT ValueType,SQLSMALLINT ParameterType,SQLULEN LengthPrecision,SQLSMALLINT ParameterScale,SQLPOINTER ParameterValue,SQLLEN *StrLen_or_Ind);
  504. #if (ODBCVER >= 0x0300)
  505. SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle,SQLINTEGER Attribute,SQLPOINTER Value,SQLINTEGER StringLength);
  506. #endif
  507. SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle,SQLUSMALLINT Option,SQLULEN Value);
  508. SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle,SQLUSMALLINT IdentifierType,SQLCHAR *CatalogName,SQLSMALLINT NameLength1,SQLCHAR *SchemaName,SQLSMALLINT NameLength2,SQLCHAR *TableName,SQLSMALLINT NameLength3,SQLUSMALLINT Scope,SQLUSMALLINT Nullable);
  509. SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle,SQLCHAR *CatalogName,SQLSMALLINT NameLength1,SQLCHAR *SchemaName,SQLSMALLINT NameLength2,SQLCHAR *TableName,SQLSMALLINT NameLength3,SQLUSMALLINT Unique,SQLUSMALLINT Reserved);
  510. SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle,SQLCHAR *CatalogName,SQLSMALLINT NameLength1,SQLCHAR *SchemaName,SQLSMALLINT NameLength2,SQLCHAR *TableName,SQLSMALLINT NameLength3,SQLCHAR *TableType,SQLSMALLINT NameLength4);
  511. SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle,SQLHDBC ConnectionHandle,SQLUSMALLINT CompletionType);
  512. #endif
  513. #ifdef __cplusplus
  514. }
  515. #endif
  516. #endif