iodbcext.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. /*
  2. * iodbcext.h
  3. *
  4. * $Id: iodbcext.h,v 1.7 2009/09/07 23:11:11 source Exp $
  5. *
  6. * iODBC extensions and changes to the SAG specifications
  7. * for third party drivers
  8. *
  9. * The iODBC driver manager.
  10. *
  11. * Copyright (C) 1996-2009 by OpenLink Software <[email protected]>
  12. * All Rights Reserved.
  13. *
  14. * This software is released under the terms of either of the following
  15. * licenses:
  16. *
  17. * - GNU Library General Public License (see LICENSE.LGPL)
  18. * - The BSD License (see LICENSE.BSD).
  19. *
  20. * Note that the only valid version of the LGPL license as far as this
  21. * project is concerned is the original GNU Library General Public License
  22. * Version 2, dated June 1991.
  23. *
  24. * While not mandated by the BSD license, any patches you make to the
  25. * iODBC source code may be contributed back into the iODBC project
  26. * at your discretion. Contributions will benefit the Open Source and
  27. * Data Access community as a whole. Submissions may be made at:
  28. *
  29. * http://www.iodbc.org
  30. *
  31. *
  32. * GNU Library Generic Public License Version 2
  33. * ============================================
  34. * This library is free software; you can redistribute it and/or
  35. * modify it under the terms of the GNU Library General Public
  36. * License as published by the Free Software Foundation; only
  37. * Version 2 of the License dated June 1991.
  38. *
  39. * This library is distributed in the hope that it will be useful,
  40. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  41. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  42. * Library General Public License for more details.
  43. *
  44. * You should have received a copy of the GNU Library General Public
  45. * License along with this library; if not, write to the Free
  46. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  47. *
  48. *
  49. * The BSD License
  50. * ===============
  51. * Redistribution and use in source and binary forms, with or without
  52. * modification, are permitted provided that the following conditions
  53. * are met:
  54. *
  55. * 1. Redistributions of source code must retain the above copyright
  56. * notice, this list of conditions and the following disclaimer.
  57. * 2. Redistributions in binary form must reproduce the above copyright
  58. * notice, this list of conditions and the following disclaimer in
  59. * the documentation and/or other materials provided with the
  60. * distribution.
  61. * 3. Neither the name of OpenLink Software Inc. nor the names of its
  62. * contributors may be used to endorse or promote products derived
  63. * from this software without specific prior written permission.
  64. *
  65. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  66. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  67. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  68. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
  69. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  70. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  71. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  72. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  73. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  74. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  75. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  76. *
  77. */
  78. #ifndef _IODBCEXT_H
  79. #define _IODBCEXT_H
  80. /*
  81. * OpenLink API Extensions
  82. */
  83. #define SQL_GETLASTROWID 1048L
  84. #define SQL_GETLASTSERIAL 1049L
  85. #define SQL_CONCUR_VAL_EXTENT 1050L
  86. #define SQL_APPLICATION_NAME 1051L /* connect option */
  87. #define SQL_PARSE_FWD_ONLY_REQ 1052L
  88. #define SQL_DESC_KEY 1053L
  89. #define SQL_APPEND_KEYS 1054L
  90. #define SQL_DESC_EXPR 1055L
  91. #define SQL_ATTR_WCHAR_SIZE 1056L
  92. #define SQL_COLUMN_ROWVER SQL_DESC_ROWVER
  93. #define SQL_COLUMN_KEY SQL_DESC_KEY
  94. #define SQL_COLUMN_EXPR SQL_DESC_EXPR
  95. #define SQL_ATTR_PARSE_FWD_ONLY_REQ SQL_PARSE_FWD_ONLY_REQ
  96. #define SQL_ATTR_APPEND_KEYS SQL_APPEND_KEYS
  97. /*
  98. * Microsoft extensions for SQLServer
  99. */
  100. /*
  101. * SQLSetConnectOption/SQLSetStmtOption driver specific defines.
  102. * Microsoft has 1200 thru 1249 reserved for Microsoft SQL Server
  103. * driver usage.
  104. */
  105. #define SQL_ATTR_ENLIST_IN_DTC 1207
  106. #define SQL_ATTR_ENLIST_IN_XA 1208
  107. #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */
  108. #define SQL_COPT_SS_BASE 1200
  109. #define SQL_COPT_SS_REMOTE_PWD (SQL_COPT_SS_BASE+1) /* dbrpwset SQLSetConnectOption only */
  110. #define SQL_COPT_SS_USE_PROC_FOR_PREP (SQL_COPT_SS_BASE+2) /* Use create proc for SQLPrepare */
  111. #define SQL_COPT_SS_INTEGRATED_SECURITY (SQL_COPT_SS_BASE+3) /* Force integrated security on login */
  112. #define SQL_COPT_SS_PRESERVE_CURSORS (SQL_COPT_SS_BASE+4) /* Preserve server cursors after SQLTransact */
  113. #define SQL_COPT_SS_USER_DATA (SQL_COPT_SS_BASE+5) /* dbgetuserdata/dbsetuserdata */
  114. #define SQL_COPT_SS_ANSI_OEM (SQL_COPT_SS_BASE+6) /* dbsetopt/DBANSItoOEM/DBOEMtoANSI */
  115. #define SQL_COPT_SS_ENLIST_IN_DTC SQL_ATTR_ENLIST_IN_DTC /* Enlist in a DTC transaction */
  116. #define SQL_COPT_SS_ENLIST_IN_XA SQL_ATTR_ENLIST_IN_XA /* Enlist in a XA transaction */
  117. #define SQL_COPT_SS_CONNECTION_DEAD SQL_ATTR_CONNECTION_DEAD /* dbdead SQLGetConnectOption only */
  118. #define SQL_COPT_SS_FALLBACK_CONNECT (SQL_COPT_SS_BASE+10) /* Enables FallBack connections */
  119. #define SQL_COPT_SS_PERF_DATA (SQL_COPT_SS_BASE+11) /* Used to access SQL Server ODBC driver performance data */
  120. #define SQL_COPT_SS_PERF_DATA_LOG (SQL_COPT_SS_BASE+12) /* Used to set the logfile name for the Performance data */
  121. #define SQL_COPT_SS_PERF_QUERY_INTERVAL (SQL_COPT_SS_BASE+13) /* Used to set the query logging threshold in milliseconds. */
  122. #define SQL_COPT_SS_PERF_QUERY_LOG (SQL_COPT_SS_BASE+14) /* Used to set the logfile name for saving queries. */
  123. #define SQL_COPT_SS_PERF_QUERY (SQL_COPT_SS_BASE+15) /* Used to start and stop query logging. */
  124. #define SQL_COPT_SS_PERF_DATA_LOG_NOW (SQL_COPT_SS_BASE+16) /* Used to make a statistics log entry to disk. */
  125. #define SQL_COPT_SS_QUOTED_IDENT (SQL_COPT_SS_BASE+17) /* Enable/Disable Quoted Identifiers */
  126. #define SQL_COPT_SS_ANSI_NPW (SQL_COPT_SS_BASE+18) /* Enable/Disable ANSI NULL, Padding and Warnings */
  127. #define SQL_COPT_SS_BCP (SQL_COPT_SS_BASE+19) /* Allow BCP usage on connection */
  128. #define SQL_COPT_SS_MAX_USED SQL_COPT_SS_BCP
  129. #define SQL_SOPT_SS_BASE 1225
  130. #define SQL_SOPT_SS_TEXTPTR_LOGGING (SQL_SOPT_SS_BASE+0) /* Text pointer logging */
  131. #define SQL_SOPT_SS_CURRENT_COMMAND (SQL_SOPT_SS_BASE+1) /* dbcurcmd SQLGetStmtOption only */
  132. #define SQL_SOPT_SS_HIDDEN_COLUMNS (SQL_SOPT_SS_BASE+2) /* Expose FOR BROWSE hidden columns */
  133. #define SQL_SOPT_SS_NOBROWSETABLE (SQL_SOPT_SS_BASE+3) /* Set NOBROWSETABLE option */
  134. #define SQL_SOPT_SS_REGIONALIZE (SQL_SOPT_SS_BASE+4) /* Regionalize output character conversions */
  135. #define SQL_SOPT_SS_MAX_USED SQL_SOPT_SS_REGIONALIZE
  136. /* Defines for use with SQL_COPT_SS_USE_PROC_FOR_PREP */
  137. #define SQL_UP_OFF 0L /*Procedures won't be used for prepare*/
  138. #define SQL_UP_ON 1L /*Procedures will be used for prepare*/
  139. #define SQL_UP_ON_DROP 2L /*Temp procedures will be explicitly dropped*/
  140. #define SQL_UP_DEFAULT SQL_UP_ON
  141. /* Defines for use with SQL_COPT_SS_INTEGRATED_SECURITY - Pre-Connect Option only */
  142. #define SQL_IS_OFF 0L /* Integrated security isn't used */
  143. #define SQL_IS_ON 1L /* Integrated security is used */
  144. #define SQL_IS_DEFAULT SQL_IS_OFF
  145. /* Defines for use with SQL_COPT_SS_PRESERVE_CURSORS */
  146. #define SQL_PC_OFF 0L /* Cursors are closed on SQLTransact */
  147. #define SQL_PC_ON 1L /* Cursors remain open on SQLTransact */
  148. #define SQL_PC_DEFAULT SQL_PC_OFF
  149. /* Defines for use with SQL_COPT_SS_USER_DATA */
  150. #define SQL_UD_NOTSET NULL /* No user data pointer set */
  151. /* Defines for use with SQL_COPT_SS_ANSI_OEM */
  152. #define SQL_AO_OFF 0L /* ANSI/OEM translation is not performed */
  153. #define SQL_AO_ON 1L /* ANSI/OEM translation is performed */
  154. #define SQL_AO_DEFAULT SQL_AO_OFF /* Default unless DSN OEM/ANSI checkbox is checked */
  155. /* Defines for use with SQL_COPT_SS_FALLBACK_CONNECT */
  156. #define SQL_FB_OFF 0L /* FallBack connections are disabled */
  157. #define SQL_FB_ON 1L /* FallBack connections are enabled */
  158. #define SQL_FB_DEFAULT SQL_FB_OFF
  159. /* Defines for use with SQL_COPT_SS_BCP */
  160. #define SQL_BCP_OFF 0L /* BCP is not allowed on connection */
  161. #define SQL_BCP_ON 1L /* BCP is allowed on connection */
  162. #define SQL_BCP_DEFAULT SQL_BCP_OFF
  163. /* Defines for use with SQL_COPT_SS_QUOTED_IDENT - Pre-Connect Option only */
  164. #define SQL_QI_OFF 0L /* Quoted identifiers are not supported */
  165. #define SQL_QI_ON 1L /* Quoted identifiers are supported */
  166. #define SQL_QI_DEFAULT SQL_QI_ON
  167. /* Defines for use with SQL_COPT_SS_ANSI_NPW - Pre-Connect Option only */
  168. #define SQL_AD_OFF 0L /* ANSI NULLs, Padding and Warnings are not supported */
  169. #define SQL_AD_ON 1L /* ANSI NULLs, Padding and Warnings are supported */
  170. #define SQL_AD_DEFAULT SQL_AD_ON
  171. /* Defines for use with SQL_SOPT_SS_TEXTPTR_LOGGING */
  172. #define SQL_TL_OFF 0L /* No logging on text pointer ops */
  173. #define SQL_TL_ON 1L /* Logging occurs on text pointer ops */
  174. #define SQL_TL_DEFAULT SQL_TL_ON
  175. /* Defines for use with SQL_SOPT_SS_HIDDEN_COLUMNS */
  176. #define SQL_HC_OFF 0L /* FOR BROWSE columns are hidden */
  177. #define SQL_HC_ON 1L /* FOR BROWSE columns are exposed */
  178. #define SQL_HC_DEFAULT SQL_HC_OFF
  179. /* Defines for use with SQL_SOPT_SS_NOBROWSETABLE */
  180. #define SQL_NB_OFF 0L /* NO_BROWSETABLE is off */
  181. #define SQL_NB_ON 1L /* NO_BROWSETABLE is on */
  182. #define SQL_NB_DEFAULT SQL_NB_OFF
  183. /* Defines for use with SQL_SOPT_SS_REGIONALIZE */
  184. #define SQL_RE_OFF 0L /* No regionalization occurs on output character conversions */
  185. #define SQL_RE_ON 1L /* Regionalization occurs on output character conversions */
  186. #define SQL_RE_DEFAULT SQL_RE_OFF
  187. /*
  188. * IBM extensions for DB2
  189. */
  190. /* Options for SQLGetStmtOption/SQLSetStmtOption extensions */
  191. #define SQL_CURSOR_HOLD 1250
  192. #define SQL_ATTR_CURSOR_HOLD 1250
  193. #define SQL_NODESCRIBE_OUTPUT 1251
  194. #define SQL_ATTR_NODESCRIBE_OUTPUT 1251
  195. #define SQL_NODESCRIBE_INPUT 1264
  196. #define SQL_ATTR_NODESCRIBE_INPUT 1264
  197. #define SQL_NODESCRIBE SQL_NODESCRIBE_OUTPUT
  198. #define SQL_ATTR_NODESCRIBE SQL_NODESCRIBE_OUTPUT
  199. #define SQL_CLOSE_BEHAVIOR 1257
  200. #define SQL_ATTR_CLOSE_BEHAVIOR 1257
  201. #define SQL_ATTR_CLOSEOPEN 1265
  202. #define SQL_ATTR_CURRENT_PACKAGE_SET 1276
  203. #define SQL_ATTR_DEFERRED_PREPARE 1277
  204. #define SQL_ATTR_EARLYCLOSE 1268
  205. #define SQL_ATTR_PROCESSCTL 1278
  206. /* SQL_CLOSE_BEHAVIOR values. */
  207. #define SQL_CC_NO_RELEASE 0
  208. #define SQL_CC_RELEASE 1
  209. #define SQL_CC_DEFAULT SQL_CC_NO_RELEASE
  210. /* SQL_ATTR_DEFERRED_PREPARE values */
  211. #define SQL_DEFERRED_PREPARE_ON 1
  212. #define SQL_DEFERRED_PREPARE_OFF 0
  213. #define SQL_DEFERRED_PREPARE_DEFAULT SQL_DEFERRED_PREPARE_ON
  214. /* SQL_ATTR_EARLYCLOSE values */
  215. #define SQL_EARLYCLOSE_ON 1
  216. #define SQL_EARLYCLOSE_OFF 0
  217. #define SQL_EARLYCLOSE_DEFAULT SQL_EARLYCLOSE_ON
  218. /* SQL_ATTR_PROCESSCTL masks */
  219. #define SQL_PROCESSCTL_NOTHREAD 0x00000001L
  220. #define SQL_PROCESSCTL_NOFORK 0x00000002L
  221. /* Options for SQL_CURSOR_HOLD */
  222. #define SQL_CURSOR_HOLD_ON 1
  223. #define SQL_CURSOR_HOLD_OFF 0
  224. #define SQL_CURSOR_HOLD_DEFAULT SQL_CURSOR_HOLD_ON
  225. /* Options for SQL_NODESCRIBE_INPUT/SQL_NODESCRIBE_OUTPUT */
  226. #define SQL_NODESCRIBE_ON 1
  227. #define SQL_NODESCRIBE_OFF 0
  228. #define SQL_NODESCRIBE_DEFAULT SQL_NODESCRIBE_OFF
  229. /* Options for SQLGetConnectOption/SQLSetConnectOption extensions */
  230. #define SQL_WCHARTYPE 1252
  231. #define SQL_LONGDATA_COMPAT 1253
  232. #define SQL_CURRENT_SCHEMA 1254
  233. #define SQL_DB2EXPLAIN 1258
  234. #define SQL_DB2ESTIMATE 1259
  235. #define SQL_PARAMOPT_ATOMIC 1260
  236. #define SQL_STMTTXN_ISOLATION 1261
  237. #define SQL_MAXCONN 1262
  238. #define SQL_ATTR_WCHARTYPE SQL_WCHARTYPE
  239. #define SQL_ATTR_LONGDATA_COMPAT SQL_LONGDATA_COMPAT
  240. #define SQL_ATTR_CURRENT_SCHEMA SQL_CURRENT_SCHEMA
  241. #define SQL_ATTR_DB2EXPLAIN SQL_DB2EXPLAIN
  242. #define SQL_ATTR_DB2ESTIMATE SQL_DB2ESTIMATE
  243. #define SQL_ATTR_PARAMOPT_ATOMIC SQL_PARAMOPT_ATOMIC
  244. #define SQL_ATTR_STMTTXN_ISOLATION SQL_STMTTXN_ISOLATION
  245. #define SQL_ATTR_MAXCONN SQL_MAXCONN
  246. /* Options for SQLSetConnectOption, SQLSetEnvAttr */
  247. #define SQL_CONNECTTYPE 1255
  248. #define SQL_SYNC_POINT 1256
  249. #define SQL_MINMEMORY_USAGE 1263
  250. #define SQL_CONN_CONTEXT 1269
  251. #define SQL_ATTR_INHERIT_NULL_CONNECT 1270
  252. #define SQL_ATTR_FORCE_CONVERSION_ON_CLIENT 1275
  253. #define SQL_ATTR_CONNECTTYPE SQL_CONNECTTYPE
  254. #define SQL_ATTR_SYNC_POINT SQL_SYNC_POINT
  255. #define SQL_ATTR_MINMEMORY_USAGE SQL_MINMEMORY_USAGE
  256. #define SQL_ATTR_CONN_CONTEXT SQL_CONN_CONTEXT
  257. /* Options for SQL_LONGDATA_COMPAT */
  258. #define SQL_LD_COMPAT_YES 1
  259. #define SQL_LD_COMPAT_NO 0
  260. #define SQL_LD_COMPAT_DEFAULT SQL_LD_COMPAT_NO
  261. /* Options for SQL_PARAMOPT_ATOMIC */
  262. #define SQL_ATOMIC_YES 1
  263. #define SQL_ATOMIC_NO 0
  264. #define SQL_ATOMIC_DEFAULT SQL_ATOMIC_YES
  265. /* Options for SQL_CONNECT_TYPE */
  266. #define SQL_CONCURRENT_TRANS 1
  267. #define SQL_COORDINATED_TRANS 2
  268. #define SQL_CONNECTTYPE_DEFAULT SQL_CONCURRENT_TRANS
  269. /* Options for SQL_SYNCPOINT */
  270. #define SQL_ONEPHASE 1
  271. #define SQL_TWOPHASE 2
  272. #define SQL_SYNCPOINT_DEFAULT SQL_ONEPHASE
  273. /* Options for SQL_DB2ESTIMATE */
  274. #define SQL_DB2ESTIMATE_ON 1
  275. #define SQL_DB2ESTIMATE_OFF 0
  276. #define SQL_DB2ESTIMATE_DEFAULT SQL_DB2ESTIMATE_OFF
  277. /* Options for SQL_DB2EXPLAIN */
  278. #define SQL_DB2EXPLAIN_OFF 0x00000000L
  279. #define SQL_DB2EXPLAIN_SNAPSHOT_ON 0x00000001L
  280. #define SQL_DB2EXPLAIN_MODE_ON 0x00000002L
  281. #define SQL_DB2EXPLAIN_SNAPSHOT_MODE_ON SQL_DB2EXPLAIN_SNAPSHOT_ON+SQL_DB2EXPLAIN_MODE_ON
  282. #define SQL_DB2EXPLAIN_ON SQL_DB2EXPLAIN_SNAPSHOT_ON
  283. #define SQL_DB2EXPLAIN_DEFAULT SQL_DB2EXPLAIN_OFF
  284. /* Options for SQL_WCHARTYPE
  285. * Note that you can only specify SQL_WCHARTYPE_CONVERT if you have an
  286. * external compile flag SQL_WCHART_CONVERT defined
  287. */
  288. #ifdef SQL_WCHART_CONVERT
  289. #define SQL_WCHARTYPE_CONVERT 1
  290. #endif
  291. #define SQL_WCHARTYPE_NOCONVERT 0
  292. #define SQL_WCHARTYPE_DEFAULT SQL_WCHARTYPE_NOCONVERT
  293. /******************* Virtuoso ODBC Extensions *******************/
  294. /*
  295. * ODBC extensions for SQLGetDescField
  296. */
  297. #define SQL_DESC_COL_DV_TYPE 1057L
  298. #define SQL_DESC_COL_DT_DT_TYPE 1058L
  299. #define SQL_DESC_COL_LITERAL_ATTR 1059L
  300. #define SQL_DESC_COL_BOX_FLAGS 1060L
  301. #define SQL_DESC_COL_LITERAL_LANG 1061L
  302. #define SQL_DESC_COL_LITERAL_TYPE 1062L
  303. /*
  304. * Virtuoso - ODBC SQL_DESC_COL_DV_TYPE
  305. */
  306. #define VIRTUOSO_DV_DATE 129
  307. #define VIRTUOSO_DV_DATETIME 211
  308. #define VIRTUOSO_DV_DOUBLE_FLOAT 191
  309. #define VIRTUOSO_DV_IRI_ID 243
  310. #define VIRTUOSO_DV_LONG_INT 189
  311. #define VIRTUOSO_DV_NUMERIC 219
  312. #define VIRTUOSO_DV_RDF 246
  313. #define VIRTUOSO_DV_SINGLE_FLOAT 190
  314. #define VIRTUOSO_DV_STRING 182
  315. #define VIRTUOSO_DV_TIME 210
  316. #define VIRTUOSO_DV_TIMESTAMP 128
  317. #define VIRTUOSO_DV_TIMESTAMP_OBJ 208
  318. /*
  319. * Virtuoso - ODBC SQL_DESC_COL_DT_DT_TYPE
  320. */
  321. #define VIRTUOSO_DT_TYPE_DATETIME 1
  322. #define VIRTUOSO_DT_TYPE_DATE 2
  323. #define VIRTUOSO_DT_TYPE_TIME 3
  324. #endif /* _IODBCEXT_H */