Leaked source code of windows server 2003
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.

1247 lines
38 KiB

  1. /*****************************************************************
  2. ** SQLEXT.H - This is the include for applications using
  3. ** the Microsoft SQL Extensions
  4. **
  5. ** (C) Copyright 1990 - 1994 By Microsoft Corp.
  6. **
  7. ** Updated 5/12/93 for 2.00 specification
  8. ** Updated 5/23/94 for 2.01 specification
  9. *********************************************************************/
  10. #ifndef __SQLEXT
  11. #define __SQLEXT
  12. #ifdef __cplusplus
  13. extern "C" { /* Assume C declarations for C++ */
  14. #endif /* __cplusplus */
  15. #ifndef __SQL
  16. #include "sql.h"
  17. #endif
  18. /* Defines used by both Level 1 and Level 2 functions */
  19. /* generally useful constants */
  20. #define SQL_MAX_OPTION_STRING_LENGTH 256
  21. /* Additional return codes */
  22. #define SQL_STILL_EXECUTING 2
  23. #define SQL_NEED_DATA 99
  24. /* SQL extended datatypes */
  25. #define SQL_DATE 9
  26. #define SQL_TIME 10
  27. #define SQL_TIMESTAMP 11
  28. #define SQL_LONGVARCHAR (-1)
  29. #define SQL_BINARY (-2)
  30. #define SQL_VARBINARY (-3)
  31. #define SQL_LONGVARBINARY (-4)
  32. #define SQL_BIGINT (-5)
  33. #define SQL_TINYINT (-6)
  34. #define SQL_BIT (-7)
  35. #define SQL_TYPE_DRIVER_START (-80)
  36. #if (ODBCVER >= 0x0200)
  37. #define SQL_SIGNED_OFFSET (-20)
  38. #define SQL_UNSIGNED_OFFSET (-22)
  39. #endif /* ODBCVER >= 0x0200 */
  40. /* C datatype to SQL datatype mapping */
  41. #define SQL_C_DATE SQL_DATE
  42. #define SQL_C_TIME SQL_TIME
  43. #define SQL_C_TIMESTAMP SQL_TIMESTAMP
  44. #define SQL_C_BINARY SQL_BINARY
  45. #define SQL_C_BIT SQL_BIT
  46. #define SQL_C_TINYINT SQL_TINYINT
  47. #if (ODBCVER >= 0x0200)
  48. #define SQL_C_SLONG SQL_C_LONG+SQL_SIGNED_OFFSET /* SIGNED INTEGER */
  49. #define SQL_C_SSHORT SQL_C_SHORT+SQL_SIGNED_OFFSET /* SIGNED SMALLINT */
  50. #define SQL_C_STINYINT SQL_TINYINT+SQL_SIGNED_OFFSET /* SIGNED TINYINT */
  51. #define SQL_C_ULONG SQL_C_LONG+SQL_UNSIGNED_OFFSET /* UNSIGNED INTEGER */
  52. #define SQL_C_USHORT SQL_C_SHORT+SQL_UNSIGNED_OFFSET /* UNSIGNED SMALLINT*/
  53. #define SQL_C_UTINYINT SQL_TINYINT+SQL_UNSIGNED_OFFSET /* UNSIGNED TINYINT */
  54. #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */
  55. #endif /* ODBCVER >= 0x0200 */
  56. #ifndef RC_INVOKED
  57. /* SQL portable types for C */
  58. /* transfer types for DATE, TIME, TIMESTAMP */
  59. typedef struct tagDATE_STRUCT
  60. {
  61. SWORD year;
  62. UWORD month;
  63. UWORD day;
  64. } DATE_STRUCT;
  65. typedef struct tagTIME_STRUCT
  66. {
  67. UWORD hour;
  68. UWORD minute;
  69. UWORD second;
  70. } TIME_STRUCT;
  71. typedef struct tagTIMESTAMP_STRUCT
  72. {
  73. SWORD year;
  74. UWORD month;
  75. UWORD day;
  76. UWORD hour;
  77. UWORD minute;
  78. UWORD second;
  79. UDWORD fraction;
  80. } TIMESTAMP_STRUCT;
  81. #if (ODBCVER >= 0x0200)
  82. typedef unsigned long int BOOKMARK;
  83. #endif /* ODBCVER >= 0x0200 */
  84. #endif /* RC_INVOKED */
  85. /* from SQL.h -- extended data types change this */
  86. #undef SQL_TYPE_MIN
  87. #define SQL_TYPE_MIN SQL_BIT
  88. #define SQL_ALL_TYPES 0
  89. /* Level 1 Functions */
  90. /* Options for SQLDriverConnect */
  91. #define SQL_DRIVER_NOPROMPT 0
  92. #define SQL_DRIVER_COMPLETE 1
  93. #define SQL_DRIVER_PROMPT 2
  94. #define SQL_DRIVER_COMPLETE_REQUIRED 3
  95. /* Special return values for SQLGetData */
  96. #define SQL_NO_TOTAL (-4)
  97. /* SQLBindParameter extensions */
  98. #if (ODBCVER >= 0x0200)
  99. #define SQL_DEFAULT_PARAM (-5)
  100. #define SQL_IGNORE (-6)
  101. #define SQL_LEN_DATA_AT_EXEC_OFFSET (-100)
  102. #define SQL_LEN_DATA_AT_EXEC(length) (-length+SQL_LEN_DATA_AT_EXEC_OFFSET)
  103. #endif /* ODBCVER >= 0x0200 */
  104. /* Defines for SQLGetFunctions */
  105. #define SQL_API_SQLALLOCCONNECT 1 /* Core Functions */
  106. #define SQL_API_SQLALLOCENV 2
  107. #define SQL_API_SQLALLOCSTMT 3
  108. #define SQL_API_SQLBINDCOL 4
  109. #define SQL_API_SQLCANCEL 5
  110. #define SQL_API_SQLCOLATTRIBUTES 6
  111. #define SQL_API_SQLCONNECT 7
  112. #define SQL_API_SQLDESCRIBECOL 8
  113. #define SQL_API_SQLDISCONNECT 9
  114. #define SQL_API_SQLERROR 10
  115. #define SQL_API_SQLEXECDIRECT 11
  116. #define SQL_API_SQLEXECUTE 12
  117. #define SQL_API_SQLFETCH 13
  118. #define SQL_API_SQLFREECONNECT 14
  119. #define SQL_API_SQLFREEENV 15
  120. #define SQL_API_SQLFREESTMT 16
  121. #define SQL_API_SQLGETCURSORNAME 17
  122. #define SQL_API_SQLNUMRESULTCOLS 18
  123. #define SQL_API_SQLPREPARE 19
  124. #define SQL_API_SQLROWCOUNT 20
  125. #define SQL_API_SQLSETCURSORNAME 21
  126. #define SQL_API_SQLSETPARAM 22
  127. #define SQL_API_SQLTRANSACT 23
  128. #define SQL_NUM_FUNCTIONS 23
  129. #define SQL_EXT_API_START 40
  130. #define SQL_API_SQLCOLUMNS 40 /* Level 1 Functions */
  131. #define SQL_API_SQLDRIVERCONNECT 41
  132. #define SQL_API_SQLGETCONNECTOPTION 42
  133. #define SQL_API_SQLGETDATA 43
  134. #define SQL_API_SQLGETFUNCTIONS 44
  135. #define SQL_API_SQLGETINFO 45
  136. #define SQL_API_SQLGETSTMTOPTION 46
  137. #define SQL_API_SQLGETTYPEINFO 47
  138. #define SQL_API_SQLPARAMDATA 48
  139. #define SQL_API_SQLPUTDATA 49
  140. #define SQL_API_SQLSETCONNECTOPTION 50
  141. #define SQL_API_SQLSETSTMTOPTION 51
  142. #define SQL_API_SQLSPECIALCOLUMNS 52
  143. #define SQL_API_SQLSTATISTICS 53
  144. #define SQL_API_SQLTABLES 54
  145. #define SQL_API_SQLBROWSECONNECT 55 /* Level 2 Functions */
  146. #define SQL_API_SQLCOLUMNPRIVILEGES 56
  147. #define SQL_API_SQLDATASOURCES 57
  148. #define SQL_API_SQLDESCRIBEPARAM 58
  149. #define SQL_API_SQLEXTENDEDFETCH 59
  150. #define SQL_API_SQLFOREIGNKEYS 60
  151. #define SQL_API_SQLMORERESULTS 61
  152. #define SQL_API_SQLNATIVESQL 62
  153. #define SQL_API_SQLNUMPARAMS 63
  154. #define SQL_API_SQLPARAMOPTIONS 64
  155. #define SQL_API_SQLPRIMARYKEYS 65
  156. #define SQL_API_SQLPROCEDURECOLUMNS 66
  157. #define SQL_API_SQLPROCEDURES 67
  158. #define SQL_API_SQLSETPOS 68
  159. #define SQL_API_SQLSETSCROLLOPTIONS 69
  160. #define SQL_API_SQLTABLEPRIVILEGES 70
  161. /* SDK 2.0 Additions */
  162. #if (ODBCVER >= 0x0200)
  163. #define SQL_API_SQLDRIVERS 71
  164. #define SQL_API_SQLBINDPARAMETER 72
  165. #define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER
  166. #else
  167. #define SQL_EXT_API_LAST SQL_API_SQLTABLEPRIVILEGES
  168. #endif /* ODBCVER >= 0x0200 */
  169. #define SQL_API_ALL_FUNCTIONS 0
  170. #define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1)
  171. #if (ODBCVER >= 0x0200)
  172. #define SQL_API_LOADBYORDINAL 199
  173. #endif /* ODBCVER >= 0x0200 */
  174. /* Defines for SQLGetInfo */
  175. #define SQL_INFO_FIRST 0
  176. #define SQL_ACTIVE_CONNECTIONS 0
  177. #define SQL_ACTIVE_STATEMENTS 1
  178. #define SQL_DATA_SOURCE_NAME 2
  179. #define SQL_DRIVER_HDBC 3
  180. #define SQL_DRIVER_HENV 4
  181. #define SQL_DRIVER_HSTMT 5
  182. #define SQL_DRIVER_NAME 6
  183. #define SQL_DRIVER_VER 7
  184. #define SQL_FETCH_DIRECTION 8
  185. #define SQL_ODBC_API_CONFORMANCE 9
  186. #define SQL_ODBC_VER 10
  187. #define SQL_ROW_UPDATES 11
  188. #define SQL_ODBC_SAG_CLI_CONFORMANCE 12
  189. #define SQL_SERVER_NAME 13
  190. #define SQL_SEARCH_PATTERN_ESCAPE 14
  191. #define SQL_ODBC_SQL_CONFORMANCE 15
  192. #define SQL_DBMS_NAME 17
  193. #define SQL_DBMS_VER 18
  194. #define SQL_ACCESSIBLE_TABLES 19
  195. #define SQL_ACCESSIBLE_PROCEDURES 20
  196. #define SQL_PROCEDURES 21
  197. #define SQL_CONCAT_NULL_BEHAVIOR 22
  198. #define SQL_CURSOR_COMMIT_BEHAVIOR 23
  199. #define SQL_CURSOR_ROLLBACK_BEHAVIOR 24
  200. #define SQL_DATA_SOURCE_READ_ONLY 25
  201. #define SQL_DEFAULT_TXN_ISOLATION 26
  202. #define SQL_EXPRESSIONS_IN_ORDERBY 27
  203. #define SQL_IDENTIFIER_CASE 28
  204. #define SQL_IDENTIFIER_QUOTE_CHAR 29
  205. #define SQL_MAX_COLUMN_NAME_LEN 30
  206. #define SQL_MAX_CURSOR_NAME_LEN 31
  207. #define SQL_MAX_OWNER_NAME_LEN 32
  208. #define SQL_MAX_PROCEDURE_NAME_LEN 33
  209. #define SQL_MAX_QUALIFIER_NAME_LEN 34
  210. #define SQL_MAX_TABLE_NAME_LEN 35
  211. #define SQL_MULT_RESULT_SETS 36
  212. #define SQL_MULTIPLE_ACTIVE_TXN 37
  213. #define SQL_OUTER_JOINS 38
  214. #define SQL_OWNER_TERM 39
  215. #define SQL_PROCEDURE_TERM 40
  216. #define SQL_QUALIFIER_NAME_SEPARATOR 41
  217. #define SQL_QUALIFIER_TERM 42
  218. #define SQL_SCROLL_CONCURRENCY 43
  219. #define SQL_SCROLL_OPTIONS 44
  220. #define SQL_TABLE_TERM 45
  221. #define SQL_TXN_CAPABLE 46
  222. #define SQL_USER_NAME 47
  223. #define SQL_CONVERT_FUNCTIONS 48
  224. #define SQL_NUMERIC_FUNCTIONS 49
  225. #define SQL_STRING_FUNCTIONS 50
  226. #define SQL_SYSTEM_FUNCTIONS 51
  227. #define SQL_TIMEDATE_FUNCTIONS 52
  228. #define SQL_CONVERT_BIGINT 53
  229. #define SQL_CONVERT_BINARY 54
  230. #define SQL_CONVERT_BIT 55
  231. #define SQL_CONVERT_CHAR 56
  232. #define SQL_CONVERT_DATE 57
  233. #define SQL_CONVERT_DECIMAL 58
  234. #define SQL_CONVERT_DOUBLE 59
  235. #define SQL_CONVERT_FLOAT 60
  236. #define SQL_CONVERT_INTEGER 61
  237. #define SQL_CONVERT_LONGVARCHAR 62
  238. #define SQL_CONVERT_NUMERIC 63
  239. #define SQL_CONVERT_REAL 64
  240. #define SQL_CONVERT_SMALLINT 65
  241. #define SQL_CONVERT_TIME 66
  242. #define SQL_CONVERT_TIMESTAMP 67
  243. #define SQL_CONVERT_TINYINT 68
  244. #define SQL_CONVERT_VARBINARY 69
  245. #define SQL_CONVERT_VARCHAR 70
  246. #define SQL_CONVERT_LONGVARBINARY 71
  247. #define SQL_TXN_ISOLATION_OPTION 72
  248. #define SQL_ODBC_SQL_OPT_IEF 73
  249. /*** ODBC SDK 1.0 Additions ***/
  250. #define SQL_CORRELATION_NAME 74
  251. #define SQL_NON_NULLABLE_COLUMNS 75
  252. /*** ODBC SDK 2.0 Additions ***/
  253. #if (ODBCVER >= 0x0200)
  254. #define SQL_DRIVER_HLIB 76
  255. #define SQL_DRIVER_ODBC_VER 77
  256. #define SQL_LOCK_TYPES 78
  257. #define SQL_POS_OPERATIONS 79
  258. #define SQL_POSITIONED_STATEMENTS 80
  259. #define SQL_GETDATA_EXTENSIONS 81
  260. #define SQL_BOOKMARK_PERSISTENCE 82
  261. #define SQL_STATIC_SENSITIVITY 83
  262. #define SQL_FILE_USAGE 84
  263. #define SQL_NULL_COLLATION 85
  264. #define SQL_ALTER_TABLE 86
  265. #define SQL_COLUMN_ALIAS 87
  266. #define SQL_GROUP_BY 88
  267. #define SQL_KEYWORDS 89
  268. #define SQL_ORDER_BY_COLUMNS_IN_SELECT 90
  269. #define SQL_OWNER_USAGE 91
  270. #define SQL_QUALIFIER_USAGE 92
  271. #define SQL_QUOTED_IDENTIFIER_CASE 93
  272. #define SQL_SPECIAL_CHARACTERS 94
  273. #define SQL_SUBQUERIES 95
  274. #define SQL_UNION 96
  275. #define SQL_MAX_COLUMNS_IN_GROUP_BY 97
  276. #define SQL_MAX_COLUMNS_IN_INDEX 98
  277. #define SQL_MAX_COLUMNS_IN_ORDER_BY 99
  278. #define SQL_MAX_COLUMNS_IN_SELECT 100
  279. #define SQL_MAX_COLUMNS_IN_TABLE 101
  280. #define SQL_MAX_INDEX_SIZE 102
  281. #define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103
  282. #define SQL_MAX_ROW_SIZE 104
  283. #define SQL_MAX_STATEMENT_LEN 105
  284. #define SQL_MAX_TABLES_IN_SELECT 106
  285. #define SQL_MAX_USER_NAME_LEN 107
  286. #define SQL_MAX_CHAR_LITERAL_LEN 108
  287. #define SQL_TIMEDATE_ADD_INTERVALS 109
  288. #define SQL_TIMEDATE_DIFF_INTERVALS 110
  289. #define SQL_NEED_LONG_DATA_LEN 111
  290. #define SQL_MAX_BINARY_LITERAL_LEN 112
  291. #define SQL_LIKE_ESCAPE_CLAUSE 113
  292. #define SQL_QUALIFIER_LOCATION 114
  293. #if (ODBCVER >= 0x0201)
  294. /*** ODBC SDK 2.01 Additions ***/
  295. #define SQL_OJ_CAPABILITIES 65002 /* Temp value until ODBC 3.0 */
  296. #endif /* ODBCVER >= 0x0201 */
  297. #define SQL_INFO_LAST SQL_QUALIFIER_LOCATION
  298. #else
  299. #define SQL_INFO_LAST SQL_NON_NULLABLE_COLUMNS
  300. #endif /* ODBCVER >= 0x0200 */
  301. #define SQL_INFO_DRIVER_START 1000
  302. /* SQL_CONVERT_* return value bitmasks */
  303. #define SQL_CVT_CHAR 0x00000001L
  304. #define SQL_CVT_NUMERIC 0x00000002L
  305. #define SQL_CVT_DECIMAL 0x00000004L
  306. #define SQL_CVT_INTEGER 0x00000008L
  307. #define SQL_CVT_SMALLINT 0x00000010L
  308. #define SQL_CVT_FLOAT 0x00000020L
  309. #define SQL_CVT_REAL 0x00000040L
  310. #define SQL_CVT_DOUBLE 0x00000080L
  311. #define SQL_CVT_VARCHAR 0x00000100L
  312. #define SQL_CVT_LONGVARCHAR 0x00000200L
  313. #define SQL_CVT_BINARY 0x00000400L
  314. #define SQL_CVT_VARBINARY 0x00000800L
  315. #define SQL_CVT_BIT 0x00001000L
  316. #define SQL_CVT_TINYINT 0x00002000L
  317. #define SQL_CVT_BIGINT 0x00004000L
  318. #define SQL_CVT_DATE 0x00008000L
  319. #define SQL_CVT_TIME 0x00010000L
  320. #define SQL_CVT_TIMESTAMP 0x00020000L
  321. #define SQL_CVT_LONGVARBINARY 0x00040000L
  322. /* SQL_CONVERT_FUNCTIONS functions */
  323. #define SQL_FN_CVT_CONVERT 0x00000001L
  324. /* SQL_STRING_FUNCTIONS functions */
  325. #define SQL_FN_STR_CONCAT 0x00000001L
  326. #define SQL_FN_STR_INSERT 0x00000002L
  327. #define SQL_FN_STR_LEFT 0x00000004L
  328. #define SQL_FN_STR_LTRIM 0x00000008L
  329. #define SQL_FN_STR_LENGTH 0x00000010L
  330. #define SQL_FN_STR_LOCATE 0x00000020L
  331. #define SQL_FN_STR_LCASE 0x00000040L
  332. #define SQL_FN_STR_REPEAT 0x00000080L
  333. #define SQL_FN_STR_REPLACE 0x00000100L
  334. #define SQL_FN_STR_RIGHT 0x00000200L
  335. #define SQL_FN_STR_RTRIM 0x00000400L
  336. #define SQL_FN_STR_SUBSTRING 0x00000800L
  337. #define SQL_FN_STR_UCASE 0x00001000L
  338. #define SQL_FN_STR_ASCII 0x00002000L
  339. #define SQL_FN_STR_CHAR 0x00004000L
  340. #if (ODBCVER >= 0x0200)
  341. #define SQL_FN_STR_DIFFERENCE 0x00008000L
  342. #define SQL_FN_STR_LOCATE_2 0x00010000L
  343. #define SQL_FN_STR_SOUNDEX 0x00020000L
  344. #define SQL_FN_STR_SPACE 0x00040000L
  345. #endif /* ODBCVER >= 0x0200 */
  346. /* SQL_NUMERIC_FUNCTIONS functions */
  347. #define SQL_FN_NUM_ABS 0x00000001L
  348. #define SQL_FN_NUM_ACOS 0x00000002L
  349. #define SQL_FN_NUM_ASIN 0x00000004L
  350. #define SQL_FN_NUM_ATAN 0x00000008L
  351. #define SQL_FN_NUM_ATAN2 0x00000010L
  352. #define SQL_FN_NUM_CEILING 0x00000020L
  353. #define SQL_FN_NUM_COS 0x00000040L
  354. #define SQL_FN_NUM_COT 0x00000080L
  355. #define SQL_FN_NUM_EXP 0x00000100L
  356. #define SQL_FN_NUM_FLOOR 0x00000200L
  357. #define SQL_FN_NUM_LOG 0x00000400L
  358. #define SQL_FN_NUM_MOD 0x00000800L
  359. #define SQL_FN_NUM_SIGN 0x00001000L
  360. #define SQL_FN_NUM_SIN 0x00002000L
  361. #define SQL_FN_NUM_SQRT 0x00004000L
  362. #define SQL_FN_NUM_TAN 0x00008000L
  363. #define SQL_FN_NUM_PI 0x00010000L
  364. #define SQL_FN_NUM_RAND 0x00020000L
  365. #if (ODBCVER >= 0x0200)
  366. #define SQL_FN_NUM_DEGREES 0x00040000L
  367. #define SQL_FN_NUM_LOG10 0x00080000L
  368. #define SQL_FN_NUM_POWER 0x00100000L
  369. #define SQL_FN_NUM_RADIANS 0x00200000L
  370. #define SQL_FN_NUM_ROUND 0x00400000L
  371. #define SQL_FN_NUM_TRUNCATE 0x00800000L
  372. #endif /* ODBCVER >= 0x0200 */
  373. /* SQL_TIMEDATE_FUNCTIONS functions */
  374. #define SQL_FN_TD_NOW 0x00000001L
  375. #define SQL_FN_TD_CURDATE 0x00000002L
  376. #define SQL_FN_TD_DAYOFMONTH 0x00000004L
  377. #define SQL_FN_TD_DAYOFWEEK 0x00000008L
  378. #define SQL_FN_TD_DAYOFYEAR 0x00000010L
  379. #define SQL_FN_TD_MONTH 0x00000020L
  380. #define SQL_FN_TD_QUARTER 0x00000040L
  381. #define SQL_FN_TD_WEEK 0x00000080L
  382. #define SQL_FN_TD_YEAR 0x00000100L
  383. #define SQL_FN_TD_CURTIME 0x00000200L
  384. #define SQL_FN_TD_HOUR 0x00000400L
  385. #define SQL_FN_TD_MINUTE 0x00000800L
  386. #define SQL_FN_TD_SECOND 0x00001000L
  387. #if (ODBCVER >= 0x0200)
  388. #define SQL_FN_TD_TIMESTAMPADD 0x00002000L
  389. #define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L
  390. #define SQL_FN_TD_DAYNAME 0x00008000L
  391. #define SQL_FN_TD_MONTHNAME 0x00010000L
  392. #endif /* ODBCVER >= 0x0200 */
  393. /* SQL_SYSTEM_FUNCTIONS functions */
  394. #define SQL_FN_SYS_USERNAME 0x00000001L
  395. #define SQL_FN_SYS_DBNAME 0x00000002L
  396. #define SQL_FN_SYS_IFNULL 0x00000004L
  397. /* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */
  398. #if (ODBCVER >= 0x0200)
  399. #define SQL_FN_TSI_FRAC_SECOND 0x00000001L
  400. #define SQL_FN_TSI_SECOND 0x00000002L
  401. #define SQL_FN_TSI_MINUTE 0x00000004L
  402. #define SQL_FN_TSI_HOUR 0x00000008L
  403. #define SQL_FN_TSI_DAY 0x00000010L
  404. #define SQL_FN_TSI_WEEK 0x00000020L
  405. #define SQL_FN_TSI_MONTH 0x00000040L
  406. #define SQL_FN_TSI_QUARTER 0x00000080L
  407. #define SQL_FN_TSI_YEAR 0x00000100L
  408. #endif /* ODBCVER >= 0x0200 */
  409. /* SQL_ODBC_API_CONFORMANCE values */
  410. #define SQL_OAC_NONE 0x0000
  411. #define SQL_OAC_LEVEL1 0x0001
  412. #define SQL_OAC_LEVEL2 0x0002
  413. /* SQL_ODBC_SAG_CLI_CONFORMANCE values */
  414. #define SQL_OSCC_NOT_COMPLIANT 0x0000
  415. #define SQL_OSCC_COMPLIANT 0x0001
  416. /* SQL_ODBC_SQL_CONFORMANCE values */
  417. #define SQL_OSC_MINIMUM 0x0000
  418. #define SQL_OSC_CORE 0x0001
  419. #define SQL_OSC_EXTENDED 0x0002
  420. /* SQL_CONCAT_NULL_BEHAVIOR values */
  421. #define SQL_CB_NULL 0x0000
  422. #define SQL_CB_NON_NULL 0x0001
  423. /* SQL_CURSOR_COMMIT_BEHAVIOR and SQL_CURSOR_ROLLBACK_BEHAVIOR values */
  424. #define SQL_CB_DELETE 0x0000
  425. #define SQL_CB_CLOSE 0x0001
  426. #define SQL_CB_PRESERVE 0x0002
  427. /* SQL_IDENTIFIER_CASE values */
  428. #define SQL_IC_UPPER 0x0001
  429. #define SQL_IC_LOWER 0x0002
  430. #define SQL_IC_SENSITIVE 0x0003
  431. #define SQL_IC_MIXED 0x0004
  432. /* SQL_TXN_CAPABLE values */
  433. #define SQL_TC_NONE 0x0000
  434. #define SQL_TC_DML 0x0001
  435. #define SQL_TC_ALL 0x0002
  436. #if (ODBCVER >= 0x0200)
  437. #define SQL_TC_DDL_COMMIT 0x0003
  438. #define SQL_TC_DDL_IGNORE 0x0004
  439. #endif /* ODBCVER >= 0x0200 */
  440. /* SQL_SCROLL_OPTIONS masks */
  441. #define SQL_SO_FORWARD_ONLY 0x00000001L
  442. #define SQL_SO_KEYSET_DRIVEN 0x00000002L
  443. #define SQL_SO_DYNAMIC 0x00000004L
  444. #define SQL_SO_MIXED 0x00000008L
  445. #if (ODBCVER >= 0x0200)
  446. #define SQL_SO_STATIC 0x00000010L
  447. #endif /* ODBCVER >= 0x0200 */
  448. /* SQL_SCROLL_CONCURRENCY masks */
  449. #define SQL_SCCO_READ_ONLY 0x00000001L
  450. #define SQL_SCCO_LOCK 0x00000002L
  451. #define SQL_SCCO_OPT_ROWVER 0x00000004L
  452. #define SQL_SCCO_OPT_VALUES 0x00000008L
  453. /* SQL_FETCH_DIRECTION masks */
  454. #define SQL_FD_FETCH_NEXT 0x00000001L
  455. #define SQL_FD_FETCH_FIRST 0x00000002L
  456. #define SQL_FD_FETCH_LAST 0x00000004L
  457. #define SQL_FD_FETCH_PRIOR 0x00000008L
  458. #define SQL_FD_FETCH_ABSOLUTE 0x00000010L
  459. #define SQL_FD_FETCH_RELATIVE 0x00000020L
  460. #define SQL_FD_FETCH_RESUME 0x00000040L
  461. #if (ODBCVER >= 0x0200)
  462. #define SQL_FD_FETCH_BOOKMARK 0x00000080L
  463. #endif /* ODBCVER >= 0x0200 */
  464. /* SQL_TXN_ISOLATION_OPTION masks */
  465. #define SQL_TXN_READ_UNCOMMITTED 0x00000001L
  466. #define SQL_TXN_READ_COMMITTED 0x00000002L
  467. #define SQL_TXN_REPEATABLE_READ 0x00000004L
  468. #define SQL_TXN_SERIALIZABLE 0x00000008L
  469. #define SQL_TXN_VERSIONING 0x00000010L
  470. /* SQL_CORRELATION_NAME values */
  471. #define SQL_CN_NONE 0x0000
  472. #define SQL_CN_DIFFERENT 0x0001
  473. #define SQL_CN_ANY 0x0002
  474. /* SQL_NON_NULLABLE_COLUMNS values */
  475. #define SQL_NNC_NULL 0x0000
  476. #define SQL_NNC_NON_NULL 0x0001
  477. #if (ODBCVER >= 0x0200)
  478. /* SQL_NULL_COLLATION values */
  479. #define SQL_NC_HIGH 0x0000
  480. #define SQL_NC_LOW 0x0001
  481. #define SQL_NC_START 0x0002
  482. #define SQL_NC_END 0x0004
  483. /* SQL_FILE_USAGE values */
  484. #define SQL_FILE_NOT_SUPPORTED 0x0000
  485. #define SQL_FILE_TABLE 0x0001
  486. #define SQL_FILE_QUALIFIER 0x0002
  487. /* SQL_GETDATA_EXTENSIONS values */
  488. #define SQL_GD_ANY_COLUMN 0x00000001L
  489. #define SQL_GD_ANY_ORDER 0x00000002L
  490. #define SQL_GD_BLOCK 0x00000004L
  491. #define SQL_GD_BOUND 0x00000008L
  492. /* SQL_ALTER_TABLE values */
  493. #define SQL_AT_ADD_COLUMN 0x00000001L
  494. #define SQL_AT_DROP_COLUMN 0x00000002L
  495. /* SQL_POSITIONED_STATEMENTS masks */
  496. #define SQL_PS_POSITIONED_DELETE 0x00000001L
  497. #define SQL_PS_POSITIONED_UPDATE 0x00000002L
  498. #define SQL_PS_SELECT_FOR_UPDATE 0x00000004L
  499. /* SQL_GROUP_BY values */
  500. #define SQL_GB_NOT_SUPPORTED 0x0000
  501. #define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001
  502. #define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002
  503. #define SQL_GB_NO_RELATION 0x0003
  504. /* SQL_OWNER_USAGE masks */
  505. #define SQL_OU_DML_STATEMENTS 0x00000001L
  506. #define SQL_OU_PROCEDURE_INVOCATION 0x00000002L
  507. #define SQL_OU_TABLE_DEFINITION 0x00000004L
  508. #define SQL_OU_INDEX_DEFINITION 0x00000008L
  509. #define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L
  510. /* SQL_QUALIFIER_USAGE masks */
  511. #define SQL_QU_DML_STATEMENTS 0x00000001L
  512. #define SQL_QU_PROCEDURE_INVOCATION 0x00000002L
  513. #define SQL_QU_TABLE_DEFINITION 0x00000004L
  514. #define SQL_QU_INDEX_DEFINITION 0x00000008L
  515. #define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L
  516. /* SQL_SUBQUERIES masks */
  517. #define SQL_SQ_COMPARISON 0x00000001L
  518. #define SQL_SQ_EXISTS 0x00000002L
  519. #define SQL_SQ_IN 0x00000004L
  520. #define SQL_SQ_QUANTIFIED 0x00000008L
  521. #define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L
  522. /* SQL_UNION masks */
  523. #define SQL_U_UNION 0x00000001L
  524. #define SQL_U_UNION_ALL 0x00000002L
  525. /* SQL_BOOKMARK_PERSISTENCE values */
  526. #define SQL_BP_CLOSE 0x00000001L
  527. #define SQL_BP_DELETE 0x00000002L
  528. #define SQL_BP_DROP 0x00000004L
  529. #define SQL_BP_TRANSACTION 0x00000008L
  530. #define SQL_BP_UPDATE 0x00000010L
  531. #define SQL_BP_OTHER_HSTMT 0x00000020L
  532. #define SQL_BP_SCROLL 0x00000040L
  533. /* SQL_STATIC_SENSITIVITY values */
  534. #define SQL_SS_ADDITIONS 0x00000001L
  535. #define SQL_SS_DELETIONS 0x00000002L
  536. #define SQL_SS_UPDATES 0x00000004L
  537. /* SQL_LOCK_TYPESL masks */
  538. #define SQL_LCK_NO_CHANGE 0x00000001L
  539. #define SQL_LCK_EXCLUSIVE 0x00000002L
  540. #define SQL_LCK_UNLOCK 0x00000004L
  541. /* SQL_POS_OPERATIONS masks */
  542. #define SQL_POS_POSITION 0x00000001L
  543. #define SQL_POS_REFRESH 0x00000002L
  544. #define SQL_POS_UPDATE 0x00000004L
  545. #define SQL_POS_DELETE 0x00000008L
  546. #define SQL_POS_ADD 0x00000010L
  547. /* SQL_QUALIFIER_LOCATION values */
  548. #define SQL_QL_START 0x0001L
  549. #define SQL_QL_END 0x0002L
  550. /* SQL_OJ_CAPABILITIES values */
  551. #if (ODBCVER >= 0x0201)
  552. #define SQL_OJ_LEFT 0x00000001L
  553. #define SQL_OJ_RIGHT 0x00000002L
  554. #define SQL_OJ_FULL 0x00000004L
  555. #define SQL_OJ_NESTED 0x00000008L
  556. #define SQL_OJ_NOT_ORDERED 0x00000010L
  557. #define SQL_OJ_INNER 0x00000020L
  558. #define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L
  559. #endif /* ODBCVER >= 0x0201 */
  560. #endif /* ODBCVER >= 0x0200 */
  561. /* options for SQLGetStmtOption/SQLSetStmtOption */
  562. #define SQL_QUERY_TIMEOUT 0
  563. #define SQL_MAX_ROWS 1
  564. #define SQL_NOSCAN 2
  565. #define SQL_MAX_LENGTH 3
  566. #define SQL_ASYNC_ENABLE 4
  567. #define SQL_BIND_TYPE 5
  568. #if (ODBCVER >= 0x0200)
  569. #define SQL_CURSOR_TYPE 6
  570. #define SQL_CONCURRENCY 7
  571. #define SQL_KEYSET_SIZE 8
  572. #define SQL_ROWSET_SIZE 9
  573. #define SQL_SIMULATE_CURSOR 10
  574. #define SQL_RETRIEVE_DATA 11
  575. #define SQL_USE_BOOKMARKS 12
  576. #define SQL_GET_BOOKMARK 13 /* GetStmtOption Only */
  577. #define SQL_ROW_NUMBER 14 /* GetStmtOption Only */
  578. #define SQL_STMT_OPT_MAX SQL_ROW_NUMBER
  579. #else
  580. #define SQL_STMT_OPT_MAX SQL_BIND_TYPE
  581. #endif /* ODBCVER >= 0x0200 */
  582. #define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT
  583. /* SQL_QUERY_TIMEOUT options */
  584. #define SQL_QUERY_TIMEOUT_DEFAULT 0UL
  585. /* SQL_MAX_ROWS options */
  586. #define SQL_MAX_ROWS_DEFAULT 0UL
  587. /* SQL_NOSCAN options */
  588. #define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */
  589. #define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */
  590. #define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF
  591. /* SQL_MAX_LENGTH options */
  592. #define SQL_MAX_LENGTH_DEFAULT 0UL
  593. /* SQL_ASYNC_ENABLE options */
  594. #define SQL_ASYNC_ENABLE_OFF 0UL
  595. #define SQL_ASYNC_ENABLE_ON 1UL
  596. #define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF
  597. /* SQL_BIND_TYPE options */
  598. #define SQL_BIND_BY_COLUMN 0UL
  599. /* SQL_CONCURRENCY options */
  600. #define SQL_CONCUR_READ_ONLY 1
  601. #define SQL_CONCUR_LOCK 2
  602. #define SQL_CONCUR_ROWVER 3
  603. #define SQL_CONCUR_VALUES 4
  604. #if (ODBCVER >= 0x0200)
  605. /* SQL_CURSOR_TYPE options */
  606. #define SQL_CURSOR_FORWARD_ONLY 0UL
  607. #define SQL_CURSOR_KEYSET_DRIVEN 1UL
  608. #define SQL_CURSOR_DYNAMIC 2UL
  609. #define SQL_CURSOR_STATIC 3UL
  610. /* SQL_ROWSET_SIZE options */
  611. #define SQL_ROWSET_SIZE_DEFAULT 1UL
  612. /* SQL_KEYSET_SIZE options */
  613. #define SQL_KEYSET_SIZE_DEFAULT 0UL
  614. /* SQL_SIMULATE_CURSOR options */
  615. #define SQL_SC_NON_UNIQUE 0UL
  616. #define SQL_SC_TRY_UNIQUE 1UL
  617. #define SQL_SC_UNIQUE 2UL
  618. /* SQL_RETRIEVE_DATA options */
  619. #define SQL_RD_OFF 0UL
  620. #define SQL_RD_ON 1UL
  621. #define SQL_RD_DEFAULT SQL_RD_ON
  622. /* SQL_USE_BOOKMARKS options */
  623. #define SQL_UB_OFF 0UL
  624. #define SQL_UB_ON 1UL
  625. #define SQL_UB_DEFAULT SQL_UB_OFF
  626. #endif /* ODBCVER >= 0x0200 */
  627. /* options for SQLSetConnectOption/SQLGetConnectOption */
  628. #define SQL_ACCESS_MODE 101
  629. #define SQL_AUTOCOMMIT 102
  630. #define SQL_LOGIN_TIMEOUT 103
  631. #define SQL_OPT_TRACE 104
  632. #define SQL_OPT_TRACEFILE 105
  633. #define SQL_TRANSLATE_DLL 106
  634. #define SQL_TRANSLATE_OPTION 107
  635. #define SQL_TXN_ISOLATION 108
  636. #define SQL_CURRENT_QUALIFIER 109
  637. #if (ODBCVER >= 0x0200)
  638. #define SQL_ODBC_CURSORS 110
  639. #define SQL_QUIET_MODE 111
  640. #define SQL_PACKET_SIZE 112
  641. #define SQL_CONN_OPT_MAX SQL_PACKET_SIZE
  642. #else
  643. #define SQL_CONN_OPT_MAX SQL_CURRENT_QUALIFIER
  644. #endif /* ODBCVER >= 0x0200 */
  645. #define SQL_CONNECT_OPT_DRVR_START 1000
  646. #define SQL_CONN_OPT_MIN SQL_ACCESS_MODE
  647. /* SQL_ACCESS_MODE options */
  648. #define SQL_MODE_READ_WRITE 0UL
  649. #define SQL_MODE_READ_ONLY 1UL
  650. #define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE
  651. /* SQL_AUTOCOMMIT options */
  652. #define SQL_AUTOCOMMIT_OFF 0UL
  653. #define SQL_AUTOCOMMIT_ON 1UL
  654. #define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON
  655. /* SQL_LOGIN_TIMEOUT options */
  656. #define SQL_LOGIN_TIMEOUT_DEFAULT 15UL
  657. /* SQL_OPT_TRACE options */
  658. #define SQL_OPT_TRACE_OFF 0UL
  659. #define SQL_OPT_TRACE_ON 1UL
  660. #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF
  661. #define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG"
  662. #if (ODBCVER >= 0x0200)
  663. /* SQL_ODBC_CURSORS options */
  664. #define SQL_CUR_USE_IF_NEEDED 0UL
  665. #define SQL_CUR_USE_ODBC 1UL
  666. #define SQL_CUR_USE_DRIVER 2UL
  667. #define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER
  668. #endif /* ODBCVER >= 0x0200 */
  669. /* Column types and scopes in SQLSpecialColumns. */
  670. #define SQL_BEST_ROWID 1
  671. #define SQL_ROWVER 2
  672. #define SQL_SCOPE_CURROW 0
  673. #define SQL_SCOPE_TRANSACTION 1
  674. #define SQL_SCOPE_SESSION 2
  675. /* Defines for SQLSetPos */
  676. #define SQL_ENTIRE_ROWSET 0
  677. /* Operations in SQLSetPos */
  678. #define SQL_POSITION 0 /* 1.0 FALSE */
  679. #define SQL_REFRESH 1 /* 1.0 TRUE */
  680. #if (ODBCVER >= 0x0200)
  681. #define SQL_UPDATE 2
  682. #define SQL_DELETE 3
  683. #define SQL_ADD 4
  684. #endif /* ODBCVER >= 0x0200 */
  685. /* Lock options in SQLSetPos */
  686. #define SQL_LOCK_NO_CHANGE 0 /* 1.0 FALSE */
  687. #define SQL_LOCK_EXCLUSIVE 1 /* 1.0 TRUE */
  688. #if (ODBCVER >= 0x0200)
  689. #define SQL_LOCK_UNLOCK 2
  690. /* Macros for SQLSetPos */
  691. #define SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE)
  692. #define SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock)
  693. #define SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock)
  694. #define SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE)
  695. #define SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE)
  696. #define SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE)
  697. #endif /* ODBCVER >= 0x0200 */
  698. #ifndef RC_INVOKED
  699. #if (ODBCVER >= 0x0200)
  700. /* This define is too large for RC */
  701. #define SQL_ODBC_KEYWORDS \
  702. "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\
  703. "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\
  704. "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\
  705. "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\
  706. "COBOL,COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\
  707. "CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\
  708. "CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\
  709. "DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\
  710. "DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\
  711. "DISTINCT,DOMAIN,DOUBLE,DROP,"\
  712. "ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\
  713. "EXISTS,EXTERNAL,EXTRACT,"\
  714. "FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\
  715. "GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\
  716. "IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\
  717. "INPUT,INSENSITIVE,INSERT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\
  718. "JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\
  719. "MATCH,MAX,MIN,MINUTE,MODULE,MONTH,MUMPS,"\
  720. "NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\
  721. "OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\
  722. "PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\
  723. "PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\
  724. "REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS,"\
  725. "SCHEMA,SCROLL,SECOND,SECTION,SELECT,SEQUENCE,SESSION,SESSION_USER,SET,SIZE,"\
  726. "SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\
  727. "SUBSTRING,SUM,SYSTEM_USER,"\
  728. "TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\
  729. "TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\
  730. "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\
  731. "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,YEAR"
  732. #endif /* ODBCVER >= 0x0200 */
  733. /* Level 1 Prototypes */
  734. RETCODE SQL_API SQLColumns(
  735. HSTMT hstmt,
  736. UCHAR FAR *szTableQualifier,
  737. SWORD cbTableQualifier,
  738. UCHAR FAR *szTableOwner,
  739. SWORD cbTableOwner,
  740. UCHAR FAR *szTableName,
  741. SWORD cbTableName,
  742. UCHAR FAR *szColumnName,
  743. SWORD cbColumnName);
  744. RETCODE SQL_API SQLDriverConnect(
  745. HDBC hdbc,
  746. HWND hwnd,
  747. UCHAR FAR *szConnStrIn,
  748. SWORD cbConnStrIn,
  749. UCHAR FAR *szConnStrOut,
  750. SWORD cbConnStrOutMax,
  751. SWORD FAR *pcbConnStrOut,
  752. UWORD fDriverCompletion);
  753. RETCODE SQL_API SQLGetConnectOption(
  754. HDBC hdbc,
  755. UWORD fOption,
  756. PTR pvParam);
  757. RETCODE SQL_API SQLGetData(
  758. HSTMT hstmt,
  759. UWORD icol,
  760. SWORD fCType,
  761. PTR rgbValue,
  762. SDWORD cbValueMax,
  763. SDWORD FAR *pcbValue);
  764. RETCODE SQL_API SQLGetFunctions(
  765. HDBC hdbc,
  766. UWORD fFunction,
  767. UWORD FAR *pfExists);
  768. RETCODE SQL_API SQLGetInfo(
  769. HDBC hdbc,
  770. UWORD fInfoType,
  771. PTR rgbInfoValue,
  772. SWORD cbInfoValueMax,
  773. SWORD FAR *pcbInfoValue);
  774. RETCODE SQL_API SQLGetStmtOption(
  775. HSTMT hstmt,
  776. UWORD fOption,
  777. PTR pvParam);
  778. RETCODE SQL_API SQLGetTypeInfo(
  779. HSTMT hstmt,
  780. SWORD fSqlType);
  781. RETCODE SQL_API SQLParamData(
  782. HSTMT hstmt,
  783. PTR FAR *prgbValue);
  784. RETCODE SQL_API SQLPutData(
  785. HSTMT hstmt,
  786. PTR rgbValue,
  787. SDWORD cbValue);
  788. RETCODE SQL_API SQLSetConnectOption(
  789. HDBC hdbc,
  790. UWORD fOption,
  791. UDWORD vParam);
  792. RETCODE SQL_API SQLSetStmtOption(
  793. HSTMT hstmt,
  794. UWORD fOption,
  795. UDWORD vParam);
  796. RETCODE SQL_API SQLSpecialColumns(
  797. HSTMT hstmt,
  798. UWORD fColType,
  799. UCHAR FAR *szTableQualifier,
  800. SWORD cbTableQualifier,
  801. UCHAR FAR *szTableOwner,
  802. SWORD cbTableOwner,
  803. UCHAR FAR *szTableName,
  804. SWORD cbTableName,
  805. UWORD fScope,
  806. UWORD fNullable);
  807. RETCODE SQL_API SQLStatistics(
  808. HSTMT hstmt,
  809. UCHAR FAR *szTableQualifier,
  810. SWORD cbTableQualifier,
  811. UCHAR FAR *szTableOwner,
  812. SWORD cbTableOwner,
  813. UCHAR FAR *szTableName,
  814. SWORD cbTableName,
  815. UWORD fUnique,
  816. UWORD fAccuracy);
  817. RETCODE SQL_API SQLTables(
  818. HSTMT hstmt,
  819. UCHAR FAR *szTableQualifier,
  820. SWORD cbTableQualifier,
  821. UCHAR FAR *szTableOwner,
  822. SWORD cbTableOwner,
  823. UCHAR FAR *szTableName,
  824. SWORD cbTableName,
  825. UCHAR FAR *szTableType,
  826. SWORD cbTableType);
  827. #endif /* RC_INVOKED */
  828. /* Level 2 Functions */
  829. /* SQLExtendedFetch "fFetchType" values */
  830. #define SQL_FETCH_NEXT 1
  831. #define SQL_FETCH_FIRST 2
  832. #define SQL_FETCH_LAST 3
  833. #define SQL_FETCH_PRIOR 4
  834. #define SQL_FETCH_ABSOLUTE 5
  835. #define SQL_FETCH_RELATIVE 6
  836. #if (ODBCVER >= 0x0200)
  837. #define SQL_FETCH_BOOKMARK 8
  838. #endif /* ODBCVER >= 0x0200 */
  839. /* SQLExtendedFetch "rgfRowStatus" element values */
  840. #define SQL_ROW_SUCCESS 0
  841. #define SQL_ROW_DELETED 1
  842. #define SQL_ROW_UPDATED 2
  843. #define SQL_ROW_NOROW 3
  844. #if (ODBCVER >= 0x0200)
  845. #define SQL_ROW_ADDED 4
  846. #define SQL_ROW_ERROR 5
  847. #endif /* ODBCVER >= 0x0200 */
  848. /* Defines for SQLForeignKeys (returned in result set) */
  849. #define SQL_CASCADE 0
  850. #define SQL_RESTRICT 1
  851. #define SQL_SET_NULL 2
  852. /* Defines for SQLBindParameter and
  853. SQLProcedureColumns (returned in the result set) */
  854. #define SQL_PARAM_TYPE_UNKNOWN 0
  855. #define SQL_PARAM_INPUT 1
  856. #define SQL_PARAM_INPUT_OUTPUT 2
  857. #define SQL_RESULT_COL 3
  858. #if (ODBCVER >= 0x0200)
  859. #define SQL_PARAM_OUTPUT 4
  860. #define SQL_RETURN_VALUE 5
  861. #endif /* ODBCVER >= 0x0200 */
  862. /* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter */
  863. #define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT
  864. #define SQL_SETPARAM_VALUE_MAX (-1L)
  865. /* Defines for SQLStatistics */
  866. #define SQL_INDEX_UNIQUE 0
  867. #define SQL_INDEX_ALL 1
  868. #define SQL_QUICK 0
  869. #define SQL_ENSURE 1
  870. /* Defines for SQLStatistics (returned in the result set) */
  871. #define SQL_TABLE_STAT 0
  872. #define SQL_INDEX_CLUSTERED 1
  873. #define SQL_INDEX_HASHED 2
  874. #define SQL_INDEX_OTHER 3
  875. #if (ODBCVER >= 0x0200)
  876. /* Defines for SQLProcedures (returned in the result set) */
  877. #define SQL_PT_UNKNOWN 0
  878. #define SQL_PT_PROCEDURE 1
  879. #define SQL_PT_FUNCTION 2
  880. /* Defines for SQLSpecialColumns (returned in the result set) */
  881. #define SQL_PC_UNKNOWN 0
  882. #define SQL_PC_NOT_PSEUDO 1
  883. #define SQL_PC_PSEUDO 2
  884. #endif /* ODBCVER >= 0x0200 */
  885. #ifndef RC_INVOKED
  886. /* Level 2 Prototypes */
  887. RETCODE SQL_API SQLBrowseConnect(
  888. HDBC hdbc,
  889. UCHAR FAR *szConnStrIn,
  890. SWORD cbConnStrIn,
  891. UCHAR FAR *szConnStrOut,
  892. SWORD cbConnStrOutMax,
  893. SWORD FAR *pcbConnStrOut);
  894. RETCODE SQL_API SQLColumnPrivileges(
  895. HSTMT hstmt,
  896. UCHAR FAR *szTableQualifier,
  897. SWORD cbTableQualifier,
  898. UCHAR FAR *szTableOwner,
  899. SWORD cbTableOwner,
  900. UCHAR FAR *szTableName,
  901. SWORD cbTableName,
  902. UCHAR FAR *szColumnName,
  903. SWORD cbColumnName);
  904. RETCODE SQL_API SQLDataSources(
  905. HENV henv,
  906. UWORD fDirection,
  907. UCHAR FAR *szDSN,
  908. SWORD cbDSNMax,
  909. SWORD FAR *pcbDSN,
  910. UCHAR FAR *szDescription,
  911. SWORD cbDescriptionMax,
  912. SWORD FAR *pcbDescription);
  913. RETCODE SQL_API SQLDescribeParam(
  914. HSTMT hstmt,
  915. UWORD ipar,
  916. SWORD FAR *pfSqlType,
  917. UDWORD FAR *pcbColDef,
  918. SWORD FAR *pibScale,
  919. SWORD FAR *pfNullable);
  920. RETCODE SQL_API SQLExtendedFetch(
  921. HSTMT hstmt,
  922. UWORD fFetchType,
  923. SDWORD irow,
  924. UDWORD FAR *pcrow,
  925. UWORD FAR *rgfRowStatus);
  926. RETCODE SQL_API SQLForeignKeys(
  927. HSTMT hstmt,
  928. UCHAR FAR *szPkTableQualifier,
  929. SWORD cbPkTableQualifier,
  930. UCHAR FAR *szPkTableOwner,
  931. SWORD cbPkTableOwner,
  932. UCHAR FAR *szPkTableName,
  933. SWORD cbPkTableName,
  934. UCHAR FAR *szFkTableQualifier,
  935. SWORD cbFkTableQualifier,
  936. UCHAR FAR *szFkTableOwner,
  937. SWORD cbFkTableOwner,
  938. UCHAR FAR *szFkTableName,
  939. SWORD cbFkTableName);
  940. RETCODE SQL_API SQLMoreResults(
  941. HSTMT hstmt);
  942. RETCODE SQL_API SQLNativeSql(
  943. HDBC hdbc,
  944. UCHAR FAR *szSqlStrIn,
  945. SDWORD cbSqlStrIn,
  946. UCHAR FAR *szSqlStr,
  947. SDWORD cbSqlStrMax,
  948. SDWORD FAR *pcbSqlStr);
  949. RETCODE SQL_API SQLNumParams(
  950. HSTMT hstmt,
  951. SWORD FAR *pcpar);
  952. RETCODE SQL_API SQLParamOptions(
  953. HSTMT hstmt,
  954. UDWORD crow,
  955. UDWORD FAR *pirow);
  956. RETCODE SQL_API SQLPrimaryKeys(
  957. HSTMT hstmt,
  958. UCHAR FAR *szTableQualifier,
  959. SWORD cbTableQualifier,
  960. UCHAR FAR *szTableOwner,
  961. SWORD cbTableOwner,
  962. UCHAR FAR *szTableName,
  963. SWORD cbTableName);
  964. RETCODE SQL_API SQLProcedureColumns(
  965. HSTMT hstmt,
  966. UCHAR FAR *szProcQualifier,
  967. SWORD cbProcQualifier,
  968. UCHAR FAR *szProcOwner,
  969. SWORD cbProcOwner,
  970. UCHAR FAR *szProcName,
  971. SWORD cbProcName,
  972. UCHAR FAR *szColumnName,
  973. SWORD cbColumnName);
  974. RETCODE SQL_API SQLProcedures(
  975. HSTMT hstmt,
  976. UCHAR FAR *szProcQualifier,
  977. SWORD cbProcQualifier,
  978. UCHAR FAR *szProcOwner,
  979. SWORD cbProcOwner,
  980. UCHAR FAR *szProcName,
  981. SWORD cbProcName);
  982. RETCODE SQL_API SQLSetPos(
  983. HSTMT hstmt,
  984. UWORD irow,
  985. UWORD fOption,
  986. UWORD fLock);
  987. RETCODE SQL_API SQLTablePrivileges(
  988. HSTMT hstmt,
  989. UCHAR FAR *szTableQualifier,
  990. SWORD cbTableQualifier,
  991. UCHAR FAR *szTableOwner,
  992. SWORD cbTableOwner,
  993. UCHAR FAR *szTableName,
  994. SWORD cbTableName);
  995. /* SDK 2.0 Additions */
  996. #if (ODBCVER >= 0x0200)
  997. RETCODE SQL_API SQLDrivers(
  998. HENV henv,
  999. UWORD fDirection,
  1000. UCHAR FAR *szDriverDesc,
  1001. SWORD cbDriverDescMax,
  1002. SWORD FAR *pcbDriverDesc,
  1003. UCHAR FAR *szDriverAttributes,
  1004. SWORD cbDrvrAttrMax,
  1005. SWORD FAR *pcbDrvrAttr);
  1006. RETCODE SQL_API SQLBindParameter(
  1007. HSTMT hstmt,
  1008. UWORD ipar,
  1009. SWORD fParamType,
  1010. SWORD fCType,
  1011. SWORD fSqlType,
  1012. UDWORD cbColDef,
  1013. SWORD ibScale,
  1014. PTR rgbValue,
  1015. SDWORD cbValueMax,
  1016. SDWORD FAR *pcbValue);
  1017. #endif /* ODBCVER >= 0x0200 */
  1018. #endif /* RC_INVOKED */
  1019. /* Deprecated defines from prior versions of ODBC */
  1020. #define SQL_DATABASE_NAME 16 /* Use SQLGetConnectOption/SQL_CURRENT_QUALIFIER */
  1021. #define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR
  1022. #define SQL_FETCH_PREV SQL_FETCH_PRIOR
  1023. #define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER
  1024. #define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER
  1025. #define SQL_CC_DELETE SQL_CB_DELETE
  1026. #define SQL_CR_DELETE SQL_CB_DELETE
  1027. #define SQL_CC_CLOSE SQL_CB_CLOSE
  1028. #define SQL_CR_CLOSE SQL_CB_CLOSE
  1029. #define SQL_CC_PRESERVE SQL_CB_PRESERVE
  1030. #define SQL_CR_PRESERVE SQL_CB_PRESERVE
  1031. #define SQL_FETCH_RESUME 7 /* Not supported by 2.0 drivers */
  1032. #define SQL_SCROLL_FORWARD_ONLY 0L /*-SQL_CURSOR_FORWARD_ONLY */
  1033. #define SQL_SCROLL_KEYSET_DRIVEN (-1L) /*-SQL_CURSOR_KEYSET_DRIVEN */
  1034. #define SQL_SCROLL_DYNAMIC (-2L) /*-SQL_CURSOR_DYNAMIC */
  1035. #if (ODBCVER >= 0x0200)
  1036. #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */
  1037. #define SQL_PC_NON_PSEUDO SQL_PC_NOT_PSEUDO
  1038. #endif /* ODBCVER >= 0x0200 */
  1039. /* Deprecrated functions from prior versions of ODBC */
  1040. #ifndef RC_INVOKED
  1041. RETCODE SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */
  1042. HSTMT hstmt,
  1043. UWORD fConcurrency,
  1044. SDWORD crowKeyset,
  1045. UWORD crowRowset);
  1046. #endif /* RC_INVOKED */
  1047. #ifdef __cplusplus
  1048. } /* End of extern "C" { */
  1049. #endif /* __cplusplus */
  1050. #endif /* __SQLEXT */