sqlext.h 75 KB

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