sql.h 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187
  1. /*
  2. * sql.h
  3. *
  4. * $Id$
  5. *
  6. * ODBC defines
  7. *
  8. * The iODBC driver manager.
  9. *
  10. * Copyright (C) 1995 Ke Jin <[email protected]>
  11. * Copyright (C) 1996-2021 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. #ifndef _SQL_H
  78. #define _SQL_H
  79. /*
  80. * Set default specification to ODBC 3.51
  81. */
  82. #ifndef ODBCVER
  83. #define ODBCVER 0x0351
  84. #endif
  85. #ifndef _SQLTYPES_H
  86. #include <sqltypes.h>
  87. #endif
  88. #ifdef __cplusplus
  89. extern "C" {
  90. #endif
  91. /*
  92. * Useful Constants
  93. */
  94. #define SQL_MAX_MESSAGE_LENGTH 512
  95. /*
  96. * Handle types
  97. */
  98. #if (ODBCVER >= 0x0300)
  99. #define SQL_HANDLE_ENV 1
  100. #define SQL_HANDLE_DBC 2
  101. #define SQL_HANDLE_STMT 3
  102. #define SQL_HANDLE_DESC 4
  103. #endif /* ODBCVER >= 0x0300 */
  104. /*
  105. * Function return codes
  106. */
  107. #define SQL_SUCCESS 0
  108. #define SQL_SUCCESS_WITH_INFO 1
  109. #define SQL_STILL_EXECUTING 2
  110. #define SQL_ERROR (-1)
  111. #define SQL_INVALID_HANDLE (-2)
  112. #define SQL_NEED_DATA 99
  113. #if (ODBCVER >= 0x0300)
  114. #define SQL_NO_DATA 100
  115. #endif /* ODBCVER >= 0x0300 */
  116. /*
  117. * Test for SQL_SUCCESS or SQL_SUCCESS_WITH_INFO
  118. */
  119. #define SQL_SUCCEEDED(rc) (((rc) & (~1)) == 0)
  120. /*
  121. * Special length values
  122. */
  123. #define SQL_NULL_DATA (-1)
  124. #define SQL_DATA_AT_EXEC (-2)
  125. /*
  126. * Flags for null-terminated strings
  127. */
  128. #define SQL_NTS (-3)
  129. #define SQL_NTSL (-3L)
  130. /*
  131. * Standard SQL datatypes, using ANSI type numbering
  132. */
  133. #define SQL_UNKNOWN_TYPE 0
  134. #define SQL_CHAR 1
  135. #define SQL_NUMERIC 2
  136. #define SQL_DECIMAL 3
  137. #define SQL_INTEGER 4
  138. #define SQL_SMALLINT 5
  139. #define SQL_FLOAT 6
  140. #define SQL_REAL 7
  141. #define SQL_DOUBLE 8
  142. #if (ODBCVER >= 0x0300)
  143. #define SQL_DATETIME 9
  144. #endif /* ODBCVER >= 0x0300 */
  145. #define SQL_VARCHAR 12
  146. /*
  147. * SQLGetTypeInfo request for all data types
  148. */
  149. #define SQL_ALL_TYPES 0
  150. /*
  151. * Statement attribute values for date/time data types
  152. */
  153. #if (ODBCVER >= 0x0300)
  154. #define SQL_TYPE_DATE 91
  155. #define SQL_TYPE_TIME 92
  156. #define SQL_TYPE_TIMESTAMP 93
  157. #endif /* ODBCVER >= 0x0300 */
  158. /*
  159. * Date/Time length constants
  160. */
  161. #if (ODBCVER >= 0x0300)
  162. #define SQL_DATE_LEN 10
  163. #define SQL_TIME_LEN 8 /* add P+1 if prec >0 */
  164. #define SQL_TIMESTAMP_LEN 19 /* add P+1 if prec >0 */
  165. #endif /* ODBCVER >= 0x0300 */
  166. /*
  167. * NULL status constants
  168. */
  169. #define SQL_NO_NULLS 0
  170. #define SQL_NULLABLE 1
  171. #define SQL_NULLABLE_UNKNOWN 2
  172. /*
  173. * NULL Handles
  174. */
  175. #define SQL_NULL_HENV 0
  176. #define SQL_NULL_HDBC 0
  177. #define SQL_NULL_HSTMT 0
  178. #if (ODBCVER >= 0x0300)
  179. #define SQL_NULL_HDESC 0
  180. #endif /* ODBCVER >= 0x0300 */
  181. /*
  182. * NULL handle for parent argument to SQLAllocHandle when allocating
  183. * a SQLHENV
  184. */
  185. #if (ODBCVER >= 0x0300)
  186. #define SQL_NULL_HANDLE 0L
  187. #endif /* ODBCVER >= 0x0300 */
  188. /*
  189. * CLI option values
  190. */
  191. #if (ODBCVER >= 0x0300)
  192. #define SQL_FALSE 0
  193. #define SQL_TRUE 1
  194. #endif /* ODBCVER >= 0x0300 */
  195. /*
  196. * Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData()
  197. */
  198. #if (ODBCVER >= 0x0300)
  199. #define SQL_DEFAULT 99
  200. #endif /* ODBCVER >= 0x0300 */
  201. /*
  202. * SQLDataSources/SQLFetchScroll - FetchOrientation
  203. */
  204. #define SQL_FETCH_NEXT 1
  205. #define SQL_FETCH_FIRST 2
  206. /*
  207. * SQLFetchScroll - FetchOrientation
  208. */
  209. #define SQL_FETCH_LAST 3
  210. #define SQL_FETCH_PRIOR 4
  211. #define SQL_FETCH_ABSOLUTE 5
  212. #define SQL_FETCH_RELATIVE 6
  213. /*
  214. * SQLFreeStmt
  215. */
  216. #define SQL_CLOSE 0
  217. #define SQL_DROP 1
  218. #define SQL_UNBIND 2
  219. #define SQL_RESET_PARAMS 3
  220. /*
  221. * SQLGetConnectAttr - connection attributes
  222. */
  223. #if (ODBCVER >= 0x0300)
  224. #define SQL_ATTR_AUTO_IPD 10001
  225. #define SQL_ATTR_METADATA_ID 10014
  226. #endif /* ODBCVER >= 0x0300 */
  227. /*
  228. * SQLGetData() code indicating that the application row descriptor
  229. * specifies the data type
  230. */
  231. #if (ODBCVER >= 0x0300)
  232. #define SQL_ARD_TYPE (-99)
  233. #endif /* ODBCVER >= 0x0300 */
  234. /*
  235. * SQLGetDescField - identifiers of fields in the SQL descriptor
  236. */
  237. #if (ODBCVER >= 0x0300)
  238. #define SQL_DESC_COUNT 1001
  239. #define SQL_DESC_TYPE 1002
  240. #define SQL_DESC_LENGTH 1003
  241. #define SQL_DESC_OCTET_LENGTH_PTR 1004
  242. #define SQL_DESC_PRECISION 1005
  243. #define SQL_DESC_SCALE 1006
  244. #define SQL_DESC_DATETIME_INTERVAL_CODE 1007
  245. #define SQL_DESC_NULLABLE 1008
  246. #define SQL_DESC_INDICATOR_PTR 1009
  247. #define SQL_DESC_DATA_PTR 1010
  248. #define SQL_DESC_NAME 1011
  249. #define SQL_DESC_UNNAMED 1012
  250. #define SQL_DESC_OCTET_LENGTH 1013
  251. #define SQL_DESC_ALLOC_TYPE 1099
  252. #endif /* ODBCVER >= 0x0300 */
  253. /*
  254. * SQLGetDescField - SQL_DESC_ALLOC_TYPE
  255. */
  256. #if (ODBCVER >= 0x0300)
  257. #define SQL_DESC_ALLOC_AUTO 1
  258. #define SQL_DESC_ALLOC_USER 2
  259. #endif /* ODBCVER >= 0x0300 */
  260. /*
  261. * SQLGetDescField - SQL_DESC_DATETIME_INTERVAL_CODE
  262. */
  263. #if (ODBCVER >= 0x0300)
  264. #define SQL_CODE_DATE 1
  265. #define SQL_CODE_TIME 2
  266. #define SQL_CODE_TIMESTAMP 3
  267. #endif /* ODBCVER >= 0x0300 */
  268. /*
  269. * SQLGetDescField - SQL_DESC_UNNAMED
  270. */
  271. #if (ODBCVER >= 0x0300)
  272. #define SQL_NAMED 0
  273. #define SQL_UNNAMED 1
  274. #endif /* ODBCVER >= 0x0300 */
  275. /*
  276. * SQLGetDiagField - identifiers of fields in the diagnostics area
  277. */
  278. #if (ODBCVER >= 0x0300)
  279. #define SQL_DIAG_RETURNCODE 1
  280. #define SQL_DIAG_NUMBER 2
  281. #define SQL_DIAG_ROW_COUNT 3
  282. #define SQL_DIAG_SQLSTATE 4
  283. #define SQL_DIAG_NATIVE 5
  284. #define SQL_DIAG_MESSAGE_TEXT 6
  285. #define SQL_DIAG_DYNAMIC_FUNCTION 7
  286. #define SQL_DIAG_CLASS_ORIGIN 8
  287. #define SQL_DIAG_SUBCLASS_ORIGIN 9
  288. #define SQL_DIAG_CONNECTION_NAME 10
  289. #define SQL_DIAG_SERVER_NAME 11
  290. #define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12
  291. #endif /* ODBCVER >= 0x0300 */
  292. /*
  293. * SQLGetDiagField - SQL_DIAG_DYNAMIC_FUNCTION_CODE
  294. */
  295. #if (ODBCVER >= 0x0300)
  296. #define SQL_DIAG_ALTER_DOMAIN 3
  297. #define SQL_DIAG_ALTER_TABLE 4
  298. #define SQL_DIAG_CALL 7
  299. #define SQL_DIAG_CREATE_ASSERTION 6
  300. #define SQL_DIAG_CREATE_CHARACTER_SET 8
  301. #define SQL_DIAG_CREATE_COLLATION 10
  302. #define SQL_DIAG_CREATE_DOMAIN 23
  303. #define SQL_DIAG_CREATE_INDEX (-1)
  304. #define SQL_DIAG_CREATE_SCHEMA 64
  305. #define SQL_DIAG_CREATE_TABLE 77
  306. #define SQL_DIAG_CREATE_TRANSLATION 79
  307. #define SQL_DIAG_CREATE_VIEW 84
  308. #define SQL_DIAG_DELETE_WHERE 19
  309. #define SQL_DIAG_DROP_ASSERTION 24
  310. #define SQL_DIAG_DROP_CHARACTER_SET 25
  311. #define SQL_DIAG_DROP_COLLATION 26
  312. #define SQL_DIAG_DROP_DOMAIN 27
  313. #define SQL_DIAG_DROP_INDEX (-2)
  314. #define SQL_DIAG_DROP_SCHEMA 31
  315. #define SQL_DIAG_DROP_TABLE 32
  316. #define SQL_DIAG_DROP_TRANSLATION 33
  317. #define SQL_DIAG_DROP_VIEW 36
  318. #define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38
  319. #define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81
  320. #define SQL_DIAG_GRANT 48
  321. #define SQL_DIAG_INSERT 50
  322. #define SQL_DIAG_REVOKE 59
  323. #define SQL_DIAG_SELECT_CURSOR 85
  324. #define SQL_DIAG_UNKNOWN_STATEMENT 0
  325. #define SQL_DIAG_UPDATE_WHERE 82
  326. #endif /* ODBCVER >= 0x0300 */
  327. /*
  328. * SQLGetEnvAttr - environment attribute
  329. */
  330. #if (ODBCVER >= 0x0300)
  331. #define SQL_ATTR_OUTPUT_NTS 10001
  332. #endif /* ODBCVER >= 0x0300 */
  333. /*
  334. * SQLGetFunctions
  335. */
  336. #define SQL_API_SQLALLOCCONNECT 1
  337. #define SQL_API_SQLALLOCENV 2
  338. #if (ODBCVER >= 0x0300)
  339. #define SQL_API_SQLALLOCHANDLE 1001
  340. #endif /* ODBCVER >= 0x0300 */
  341. #define SQL_API_SQLALLOCSTMT 3
  342. #define SQL_API_SQLBINDCOL 4
  343. #if (ODBCVER >= 0x0300)
  344. #define SQL_API_SQLBINDPARAM 1002
  345. #endif /* ODBCVER >= 0x0300 */
  346. #define SQL_API_SQLCANCEL 5
  347. #if (ODBCVER >= 0x0300)
  348. #define SQL_API_SQLCLOSECURSOR 1003
  349. #define SQL_API_SQLCOLATTRIBUTE 6
  350. #endif /* ODBCVER >= 0x0300 */
  351. #define SQL_API_SQLCOLUMNS 40
  352. #define SQL_API_SQLCONNECT 7
  353. #if (ODBCVER >= 0x0300)
  354. #define SQL_API_SQLCOPYDESC 1004
  355. #endif /* ODBCVER >= 0x0300 */
  356. #define SQL_API_SQLDATASOURCES 57
  357. #define SQL_API_SQLDESCRIBECOL 8
  358. #define SQL_API_SQLDISCONNECT 9
  359. #if (ODBCVER >= 0x0300)
  360. #define SQL_API_SQLENDTRAN 1005
  361. #endif /* ODBCVER >= 0x0300 */
  362. #define SQL_API_SQLERROR 10
  363. #define SQL_API_SQLEXECDIRECT 11
  364. #define SQL_API_SQLEXECUTE 12
  365. #define SQL_API_SQLFETCH 13
  366. #if (ODBCVER >= 0x0300)
  367. #define SQL_API_SQLFETCHSCROLL 1021
  368. #endif /* ODBCVER >= 0x0300 */
  369. #define SQL_API_SQLFREECONNECT 14
  370. #define SQL_API_SQLFREEENV 15
  371. #if (ODBCVER >= 0x0300)
  372. #define SQL_API_SQLFREEHANDLE 1006
  373. #endif /* ODBCVER >= 0x0300 */
  374. #define SQL_API_SQLFREESTMT 16
  375. #if (ODBCVER >= 0x0300)
  376. #define SQL_API_SQLGETCONNECTATTR 1007
  377. #endif /* ODBCVER >= 0x0300 */
  378. #define SQL_API_SQLGETCONNECTOPTION 42
  379. #define SQL_API_SQLGETCURSORNAME 17
  380. #define SQL_API_SQLGETDATA 43
  381. #if (ODBCVER >= 0x0300)
  382. #define SQL_API_SQLGETDESCFIELD 1008
  383. #define SQL_API_SQLGETDESCREC 1009
  384. #define SQL_API_SQLGETDIAGFIELD 1010
  385. #define SQL_API_SQLGETDIAGREC 1011
  386. #define SQL_API_SQLGETENVATTR 1012
  387. #endif /* ODBCVER >= 0x0300 */
  388. #define SQL_API_SQLGETFUNCTIONS 44
  389. #define SQL_API_SQLGETINFO 45
  390. #if (ODBCVER >= 0x0300)
  391. #define SQL_API_SQLGETSTMTATTR 1014
  392. #endif /* ODBCVER >= 0x0300 */
  393. #define SQL_API_SQLGETSTMTOPTION 46
  394. #define SQL_API_SQLGETTYPEINFO 47
  395. #define SQL_API_SQLNUMRESULTCOLS 18
  396. #define SQL_API_SQLPARAMDATA 48
  397. #define SQL_API_SQLPREPARE 19
  398. #define SQL_API_SQLPUTDATA 49
  399. #define SQL_API_SQLROWCOUNT 20
  400. #if (ODBCVER >= 0x0300)
  401. #define SQL_API_SQLSETCONNECTATTR 1016
  402. #endif /* ODBCVER >= 0x0300 */
  403. #define SQL_API_SQLSETCONNECTOPTION 50
  404. #define SQL_API_SQLSETCURSORNAME 21
  405. #if (ODBCVER >= 0x0300)
  406. #define SQL_API_SQLSETDESCFIELD 1017
  407. #define SQL_API_SQLSETDESCREC 1018
  408. #define SQL_API_SQLSETENVATTR 1019
  409. #endif /* ODBCVER >= 0x0300 */
  410. #define SQL_API_SQLSETPARAM 22
  411. #if (ODBCVER >= 0x0300)
  412. #define SQL_API_SQLSETSTMTATTR 1020
  413. #endif /* ODBCVER >= 0x0300 */
  414. #define SQL_API_SQLSETSTMTOPTION 51
  415. #define SQL_API_SQLSPECIALCOLUMNS 52
  416. #define SQL_API_SQLSTATISTICS 53
  417. #define SQL_API_SQLTABLES 54
  418. #define SQL_API_SQLTRANSACT 23
  419. /*
  420. * SQLGetInfo
  421. */
  422. #if (ODBCVER >= 0x0300)
  423. #define SQL_MAX_DRIVER_CONNECTIONS 0
  424. #define SQL_MAXIMUM_DRIVER_CONNECTIONS SQL_MAX_DRIVER_CONNECTIONS
  425. #define SQL_MAX_CONCURRENT_ACTIVITIES 1
  426. #define SQL_MAXIMUM_CONCURRENT_ACTIVITIES SQL_MAX_CONCURRENT_ACTIVITIES
  427. #endif /* ODBCVER >= 0x0300 */
  428. #define SQL_DATA_SOURCE_NAME 2
  429. #define SQL_FETCH_DIRECTION 8
  430. #define SQL_SERVER_NAME 13
  431. #define SQL_SEARCH_PATTERN_ESCAPE 14
  432. #define SQL_DBMS_NAME 17
  433. #define SQL_DBMS_VER 18
  434. #define SQL_ACCESSIBLE_TABLES 19
  435. #define SQL_ACCESSIBLE_PROCEDURES 20
  436. #define SQL_CURSOR_COMMIT_BEHAVIOR 23
  437. #define SQL_DATA_SOURCE_READ_ONLY 25
  438. #define SQL_DEFAULT_TXN_ISOLATION 26
  439. #define SQL_IDENTIFIER_CASE 28
  440. #define SQL_IDENTIFIER_QUOTE_CHAR 29
  441. #define SQL_MAX_COLUMN_NAME_LEN 30
  442. #define SQL_MAXIMUM_COLUMN_NAME_LENGTH SQL_MAX_COLUMN_NAME_LEN
  443. #define SQL_MAX_CURSOR_NAME_LEN 31
  444. #define SQL_MAXIMUM_CURSOR_NAME_LENGTH SQL_MAX_CURSOR_NAME_LEN
  445. #define SQL_MAX_SCHEMA_NAME_LEN 32
  446. #define SQL_MAXIMUM_SCHEMA_NAME_LENGTH SQL_MAX_SCHEMA_NAME_LEN
  447. #define SQL_MAX_CATALOG_NAME_LEN 34
  448. #define SQL_MAXIMUM_CATALOG_NAME_LENGTH SQL_MAX_CATALOG_NAME_LEN
  449. #define SQL_MAX_TABLE_NAME_LEN 35
  450. #define SQL_SCROLL_CONCURRENCY 43
  451. #define SQL_TXN_CAPABLE 46
  452. #define SQL_TRANSACTION_CAPABLE SQL_TXN_CAPABLE
  453. #define SQL_USER_NAME 47
  454. #define SQL_TXN_ISOLATION_OPTION 72
  455. #define SQL_TRANSACTION_ISOLATION_OPTION SQL_TXN_ISOLATION_OPTION
  456. #define SQL_INTEGRITY 73
  457. #define SQL_GETDATA_EXTENSIONS 81
  458. #define SQL_NULL_COLLATION 85
  459. #define SQL_ALTER_TABLE 86
  460. #define SQL_ORDER_BY_COLUMNS_IN_SELECT 90
  461. #define SQL_SPECIAL_CHARACTERS 94
  462. #define SQL_MAX_COLUMNS_IN_GROUP_BY 97
  463. #define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY SQL_MAX_COLUMNS_IN_GROUP_BY
  464. #define SQL_MAX_COLUMNS_IN_INDEX 98
  465. #define SQL_MAXIMUM_COLUMNS_IN_INDEX SQL_MAX_COLUMNS_IN_INDEX
  466. #define SQL_MAX_COLUMNS_IN_ORDER_BY 99
  467. #define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY SQL_MAX_COLUMNS_IN_ORDER_BY
  468. #define SQL_MAX_COLUMNS_IN_SELECT 100
  469. #define SQL_MAXIMUM_COLUMNS_IN_SELECT SQL_MAX_COLUMNS_IN_SELECT
  470. #define SQL_MAX_COLUMNS_IN_TABLE 101
  471. #define SQL_MAX_INDEX_SIZE 102
  472. #define SQL_MAXIMUM_INDEX_SIZE SQL_MAX_INDEX_SIZE
  473. #define SQL_MAX_ROW_SIZE 104
  474. #define SQL_MAXIMUM_ROW_SIZE SQL_MAX_ROW_SIZE
  475. #define SQL_MAX_STATEMENT_LEN 105
  476. #define SQL_MAXIMUM_STATEMENT_LENGTH SQL_MAX_STATEMENT_LEN
  477. #define SQL_MAX_TABLES_IN_SELECT 106
  478. #define SQL_MAXIMUM_TABLES_IN_SELECT SQL_MAX_TABLES_IN_SELECT
  479. #define SQL_MAX_USER_NAME_LEN 107
  480. #define SQL_MAXIMUM_USER_NAME_LENGTH SQL_MAX_USER_NAME_LEN
  481. #if (ODBCVER >= 0x0300)
  482. #define SQL_OJ_CAPABILITIES 115
  483. #define SQL_OUTER_JOIN_CAPABILITIES SQL_OJ_CAPABILITIES
  484. #endif /* ODBCVER >= 0x0300 */
  485. #if (ODBCVER >= 0x0300)
  486. #define SQL_XOPEN_CLI_YEAR 10000
  487. #define SQL_CURSOR_SENSITIVITY 10001
  488. #define SQL_DESCRIBE_PARAMETER 10002
  489. #define SQL_CATALOG_NAME 10003
  490. #define SQL_COLLATION_SEQ 10004
  491. #define SQL_MAX_IDENTIFIER_LEN 10005
  492. #define SQL_MAXIMUM_IDENTIFIER_LENGTH SQL_MAX_IDENTIFIER_LEN
  493. #endif /* ODBCVER >= 0x0300 */
  494. /*
  495. * SQLGetInfo - SQL_ALTER_TABLE
  496. */
  497. #if (ODBCVER >= 0x0200)
  498. #define SQL_AT_ADD_COLUMN 0x00000001L
  499. #define SQL_AT_DROP_COLUMN 0x00000002L
  500. #endif /* ODBCVER >= 0x0300 */
  501. #if (ODBCVER >= 0x0300)
  502. #define SQL_AT_ADD_CONSTRAINT 0x00000008L
  503. /*
  504. * The following bitmasks are ODBC extensions and defined in sqlext.h:
  505. *
  506. * #define SQL_AT_COLUMN_SINGLE 0x00000020L
  507. * #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
  508. * #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
  509. * #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
  510. * #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
  511. * #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
  512. * #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
  513. * #define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
  514. * #define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
  515. * #define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
  516. * #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
  517. * #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
  518. * #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
  519. * #define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
  520. * #define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
  521. */
  522. #endif /* ODBCVER >= 0x0300 */
  523. /*
  524. * SQLGetInfo - SQL_ASYNC_MODE
  525. */
  526. #if (ODBCVER >= 0x0300)
  527. #define SQL_AM_NONE 0
  528. #define SQL_AM_CONNECTION 1
  529. #define SQL_AM_STATEMENT 2
  530. #endif /* ODBCVER >= 0x0300 */
  531. /*
  532. * SQLGetInfo - SQL_CURSOR_COMMIT_BEHAVIOR
  533. */
  534. #define SQL_CB_DELETE 0
  535. #define SQL_CB_CLOSE 1
  536. #define SQL_CB_PRESERVE 2
  537. /*
  538. * SQLGetInfo - SQL_FETCH_DIRECTION
  539. */
  540. #define SQL_FD_FETCH_NEXT 0x00000001L
  541. #define SQL_FD_FETCH_FIRST 0x00000002L
  542. #define SQL_FD_FETCH_LAST 0x00000004L
  543. #define SQL_FD_FETCH_PRIOR 0x00000008L
  544. #define SQL_FD_FETCH_ABSOLUTE 0x00000010L
  545. #define SQL_FD_FETCH_RELATIVE 0x00000020L
  546. /*
  547. * SQLGetInfo - SQL_GETDATA_EXTENSIONS
  548. */
  549. #define SQL_GD_ANY_COLUMN 0x00000001L
  550. #define SQL_GD_ANY_ORDER 0x00000002L
  551. /*
  552. * SQLGetInfo - SQL_IDENTIFIER_CASE
  553. */
  554. #define SQL_IC_UPPER 1
  555. #define SQL_IC_LOWER 2
  556. #define SQL_IC_SENSITIVE 3
  557. #define SQL_IC_MIXED 4
  558. /*
  559. * SQLGetInfo - SQL_NULL_COLLATION
  560. */
  561. #define SQL_NC_HIGH 0
  562. #define SQL_NC_LOW 1
  563. /*
  564. * SQLGetInfo - SQL_OJ_CAPABILITIES
  565. */
  566. #if (ODBCVER >= 0x0201)
  567. #define SQL_OJ_LEFT 0x00000001L
  568. #define SQL_OJ_RIGHT 0x00000002L
  569. #define SQL_OJ_FULL 0x00000004L
  570. #define SQL_OJ_NESTED 0x00000008L
  571. #define SQL_OJ_NOT_ORDERED 0x00000010L
  572. #define SQL_OJ_INNER 0x00000020L
  573. #define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L
  574. #endif
  575. /*
  576. * SQLGetInfo - SQL_SCROLL_CONCURRENCY
  577. */
  578. #define SQL_SCCO_READ_ONLY 0x00000001L
  579. #define SQL_SCCO_LOCK 0x00000002L
  580. #define SQL_SCCO_OPT_ROWVER 0x00000004L
  581. #define SQL_SCCO_OPT_VALUES 0x00000008L
  582. /*
  583. * SQLGetInfo - SQL_TXN_CAPABLE
  584. */
  585. #define SQL_TC_NONE 0
  586. #define SQL_TC_DML 1
  587. #define SQL_TC_ALL 2
  588. #define SQL_TC_DDL_COMMIT 3
  589. #define SQL_TC_DDL_IGNORE 4
  590. /*
  591. * SQLGetInfo - SQL_TXN_ISOLATION_OPTION
  592. */
  593. #define SQL_TXN_READ_UNCOMMITTED 0x00000001L
  594. #define SQL_TRANSACTION_READ_UNCOMMITTED SQL_TXN_READ_UNCOMMITTED
  595. #define SQL_TXN_READ_COMMITTED 0x00000002L
  596. #define SQL_TRANSACTION_READ_COMMITTED SQL_TXN_READ_COMMITTED
  597. #define SQL_TXN_REPEATABLE_READ 0x00000004L
  598. #define SQL_TRANSACTION_REPEATABLE_READ SQL_TXN_REPEATABLE_READ
  599. #define SQL_TXN_SERIALIZABLE 0x00000008L
  600. #define SQL_TRANSACTION_SERIALIZABLE SQL_TXN_SERIALIZABLE
  601. /*
  602. * SQLGetStmtAttr - statement attributes
  603. */
  604. #if (ODBCVER >= 0x0300)
  605. #define SQL_ATTR_APP_ROW_DESC 10010
  606. #define SQL_ATTR_APP_PARAM_DESC 10011
  607. #define SQL_ATTR_IMP_ROW_DESC 10012
  608. #define SQL_ATTR_IMP_PARAM_DESC 10013
  609. #define SQL_ATTR_CURSOR_SCROLLABLE (-1)
  610. #define SQL_ATTR_CURSOR_SENSITIVITY (-2)
  611. #endif /* ODBCVER >= 0x0300 */
  612. /*
  613. * SQLGetStmtAttr - SQL_ATTR_CURSOR_SCROLLABLE
  614. */
  615. #if (ODBCVER >= 0x0300)
  616. #define SQL_NONSCROLLABLE 0
  617. #define SQL_SCROLLABLE 1
  618. #endif /* ODBCVER >= 0x0300 */
  619. /*
  620. * SQLGetStmtAttr - SQL_ATTR_CURSOR_SENSITIVITY
  621. */
  622. #if (ODBCVER >= 0x0300)
  623. #define SQL_UNSPECIFIED 0
  624. #define SQL_INSENSITIVE 1
  625. #define SQL_SENSITIVE 2
  626. #endif /* ODBCVER >= 0x0300 */
  627. /*
  628. * SQLGetTypeInfo - SEARCHABLE
  629. */
  630. #if (ODBCVER >= 0x0300)
  631. #define SQL_PRED_NONE 0
  632. #define SQL_PRED_CHAR 1
  633. #define SQL_PRED_BASIC 2
  634. #endif /* ODBCVER >= 0x0300 */
  635. /*
  636. * SQLSpecialColumns - Column scopes
  637. */
  638. #define SQL_SCOPE_CURROW 0
  639. #define SQL_SCOPE_TRANSACTION 1
  640. #define SQL_SCOPE_SESSION 2
  641. /*
  642. * SQLSpecialColumns - PSEUDO_COLUMN
  643. */
  644. #define SQL_PC_UNKNOWN 0
  645. #if (ODBCVER >= 0x0300)
  646. #define SQL_PC_NON_PSEUDO 1
  647. #endif /* ODBCVER >= 0x0300 */
  648. #define SQL_PC_PSEUDO 2
  649. /*
  650. * SQLSpecialColumns - IdentifierType
  651. */
  652. #if (ODBCVER >= 0x0300)
  653. #define SQL_ROW_IDENTIFIER 1
  654. #endif /* ODBCVER >= 0x0300 */
  655. /*
  656. * SQLStatistics - fUnique
  657. */
  658. #define SQL_INDEX_UNIQUE 0
  659. #define SQL_INDEX_ALL 1
  660. /*
  661. * SQLStatistics - TYPE
  662. */
  663. #define SQL_INDEX_CLUSTERED 1
  664. #define SQL_INDEX_HASHED 2
  665. #define SQL_INDEX_OTHER 3
  666. /*
  667. * SQLTransact/SQLEndTran
  668. */
  669. #define SQL_COMMIT 0
  670. #define SQL_ROLLBACK 1
  671. /*
  672. * Function Prototypes
  673. */
  674. SQLRETURN SQL_API SQLAllocConnect (
  675. SQLHENV EnvironmentHandle,
  676. SQLHDBC * ConnectionHandle);
  677. SQLRETURN SQL_API SQLAllocEnv (
  678. SQLHENV * EnvironmentHandle);
  679. #if (ODBCVER >= 0x0300)
  680. SQLRETURN SQL_API SQLAllocHandle (
  681. SQLSMALLINT HandleType,
  682. SQLHANDLE InputHandle,
  683. SQLHANDLE * OutputHandle);
  684. #endif /* ODBCVER >= 0x0300 */
  685. SQLRETURN SQL_API SQLAllocStmt (
  686. SQLHDBC ConnectionHandle,
  687. SQLHSTMT * StatementHandle);
  688. SQLRETURN SQL_API SQLBindCol (
  689. SQLHSTMT StatementHandle,
  690. SQLUSMALLINT ColumnNumber,
  691. SQLSMALLINT TargetType,
  692. SQLPOINTER TargetValue,
  693. SQLLEN BufferLength,
  694. SQLLEN * StrLen_or_Ind);
  695. #if (ODBCVER >= 0x0300)
  696. SQLRETURN SQL_API SQLBindParam (
  697. SQLHSTMT StatementHandle,
  698. SQLUSMALLINT ParameterNumber,
  699. SQLSMALLINT ValueType,
  700. SQLSMALLINT ParameterType,
  701. SQLULEN LengthPrecision,
  702. SQLSMALLINT ParameterScale,
  703. SQLPOINTER ParameterValue,
  704. SQLLEN * StrLen_or_Ind);
  705. #endif
  706. SQLRETURN SQL_API SQLCancel (
  707. SQLHSTMT StatementHandle);
  708. #if (ODBCVER >= 0x0300)
  709. SQLRETURN SQL_API SQLCloseCursor (
  710. SQLHSTMT StatementHandle);
  711. /*
  712. * Using SQLLEN * instead of SQLPOINTER for NumericAttribute,
  713. * makes the prototype the same as SQLColAttributes (deprecated)
  714. * and clearer for 64bit ports
  715. */
  716. SQLRETURN SQL_API SQLColAttribute (
  717. SQLHSTMT StatementHandle,
  718. SQLUSMALLINT ColumnNumber,
  719. SQLUSMALLINT FieldIdentifier,
  720. SQLPOINTER CharacterAttribute,
  721. SQLSMALLINT BufferLength,
  722. SQLSMALLINT * StringLength,
  723. SQLLEN * NumericAttribute);
  724. #endif
  725. SQLRETURN SQL_API SQLColumns (
  726. SQLHSTMT StatementHandle,
  727. SQLCHAR * CatalogName,
  728. SQLSMALLINT NameLength1,
  729. SQLCHAR * SchemaName,
  730. SQLSMALLINT NameLength2,
  731. SQLCHAR * TableName,
  732. SQLSMALLINT NameLength3,
  733. SQLCHAR * ColumnName,
  734. SQLSMALLINT NameLength4);
  735. SQLRETURN SQL_API SQLConnect (
  736. SQLHDBC ConnectionHandle,
  737. SQLCHAR * ServerName,
  738. SQLSMALLINT NameLength1,
  739. SQLCHAR * UserName,
  740. SQLSMALLINT NameLength2,
  741. SQLCHAR * Authentication,
  742. SQLSMALLINT NameLength3);
  743. #if (ODBCVER >= 0x0300)
  744. SQLRETURN SQL_API SQLCopyDesc (
  745. SQLHDESC SourceDescHandle,
  746. SQLHDESC TargetDescHandle);
  747. #endif
  748. SQLRETURN SQL_API SQLDataSources (
  749. SQLHENV EnvironmentHandle,
  750. SQLUSMALLINT Direction,
  751. SQLCHAR * ServerName,
  752. SQLSMALLINT BufferLength1,
  753. SQLSMALLINT * NameLength1,
  754. SQLCHAR * Description,
  755. SQLSMALLINT BufferLength2,
  756. SQLSMALLINT * NameLength2);
  757. SQLRETURN SQL_API SQLDescribeCol (
  758. SQLHSTMT StatementHandle,
  759. SQLUSMALLINT ColumnNumber,
  760. SQLCHAR * ColumnName,
  761. SQLSMALLINT BufferLength,
  762. SQLSMALLINT * NameLength,
  763. SQLSMALLINT * DataType,
  764. SQLULEN * ColumnSize,
  765. SQLSMALLINT * DecimalDigits,
  766. SQLSMALLINT * Nullable);
  767. SQLRETURN SQL_API SQLDisconnect (
  768. SQLHDBC ConnectionHandle);
  769. #if (ODBCVER >= 0x0300)
  770. SQLRETURN SQL_API SQLEndTran (
  771. SQLSMALLINT HandleType,
  772. SQLHANDLE Handle,
  773. SQLSMALLINT CompletionType);
  774. #endif
  775. SQLRETURN SQL_API SQLError (
  776. SQLHENV EnvironmentHandle,
  777. SQLHDBC ConnectionHandle,
  778. SQLHSTMT StatementHandle,
  779. SQLCHAR * Sqlstate,
  780. SQLINTEGER * NativeError,
  781. SQLCHAR * MessageText,
  782. SQLSMALLINT BufferLength,
  783. SQLSMALLINT * TextLength);
  784. SQLRETURN SQL_API SQLExecDirect (
  785. SQLHSTMT StatementHandle,
  786. SQLCHAR * StatementText,
  787. SQLINTEGER TextLength);
  788. SQLRETURN SQL_API SQLExecute (
  789. SQLHSTMT StatementHandle);
  790. SQLRETURN SQL_API SQLFetch (
  791. SQLHSTMT StatementHandle);
  792. #if (ODBCVER >= 0x0300)
  793. SQLRETURN SQL_API SQLFetchScroll (
  794. SQLHSTMT StatementHandle,
  795. SQLSMALLINT FetchOrientation,
  796. SQLLEN FetchOffset);
  797. #endif
  798. SQLRETURN SQL_API SQLFreeConnect (
  799. SQLHDBC ConnectionHandle);
  800. SQLRETURN SQL_API SQLFreeEnv (
  801. SQLHENV EnvironmentHandle);
  802. #if (ODBCVER >= 0x0300)
  803. SQLRETURN SQL_API SQLFreeHandle (
  804. SQLSMALLINT HandleType,
  805. SQLHANDLE Handle);
  806. #endif
  807. SQLRETURN SQL_API SQLFreeStmt (
  808. SQLHSTMT StatementHandle,
  809. SQLUSMALLINT Option);
  810. #if (ODBCVER >= 0x0300)
  811. SQLRETURN SQL_API SQLGetConnectAttr (
  812. SQLHDBC ConnectionHandle,
  813. SQLINTEGER Attribute,
  814. SQLPOINTER Value,
  815. SQLINTEGER BufferLength,
  816. SQLINTEGER * StringLength);
  817. #endif
  818. SQLRETURN SQL_API SQLGetConnectOption (
  819. SQLHDBC ConnectionHandle,
  820. SQLUSMALLINT Option,
  821. SQLPOINTER Value);
  822. SQLRETURN SQL_API SQLGetCursorName (
  823. SQLHSTMT StatementHandle,
  824. SQLCHAR * CursorName,
  825. SQLSMALLINT BufferLength,
  826. SQLSMALLINT * NameLength);
  827. SQLRETURN SQL_API SQLGetData (
  828. SQLHSTMT StatementHandle,
  829. SQLUSMALLINT ColumnNumber,
  830. SQLSMALLINT TargetType,
  831. SQLPOINTER TargetValue,
  832. SQLLEN BufferLength,
  833. SQLLEN * StrLen_or_Ind);
  834. #if (ODBCVER >= 0x0300)
  835. SQLRETURN SQL_API SQLGetDescField (
  836. SQLHDESC DescriptorHandle,
  837. SQLSMALLINT RecNumber,
  838. SQLSMALLINT FieldIdentifier,
  839. SQLPOINTER Value,
  840. SQLINTEGER BufferLength,
  841. SQLINTEGER * StringLength);
  842. SQLRETURN SQL_API SQLGetDescRec (
  843. SQLHDESC DescriptorHandle,
  844. SQLSMALLINT RecNumber,
  845. SQLCHAR * Name,
  846. SQLSMALLINT BufferLength,
  847. SQLSMALLINT * StringLength,
  848. SQLSMALLINT * Type,
  849. SQLSMALLINT * SubType,
  850. SQLLEN * Length,
  851. SQLSMALLINT * Precision,
  852. SQLSMALLINT * Scale,
  853. SQLSMALLINT * Nullable);
  854. SQLRETURN SQL_API SQLGetDiagField (
  855. SQLSMALLINT HandleType,
  856. SQLHANDLE Handle,
  857. SQLSMALLINT RecNumber,
  858. SQLSMALLINT DiagIdentifier,
  859. SQLPOINTER DiagInfo,
  860. SQLSMALLINT BufferLength,
  861. SQLSMALLINT * StringLength);
  862. SQLRETURN SQL_API SQLGetDiagRec (
  863. SQLSMALLINT HandleType,
  864. SQLHANDLE Handle,
  865. SQLSMALLINT RecNumber,
  866. SQLCHAR * Sqlstate,
  867. SQLINTEGER * NativeError,
  868. SQLCHAR * MessageText,
  869. SQLSMALLINT BufferLength,
  870. SQLSMALLINT * TextLength);
  871. SQLRETURN SQL_API SQLGetEnvAttr (
  872. SQLHENV EnvironmentHandle,
  873. SQLINTEGER Attribute,
  874. SQLPOINTER Value,
  875. SQLINTEGER BufferLength,
  876. SQLINTEGER * StringLength);
  877. #endif /* ODBCVER >= 0x0300 */
  878. SQLRETURN SQL_API SQLGetFunctions (
  879. SQLHDBC ConnectionHandle,
  880. SQLUSMALLINT FunctionId,
  881. SQLUSMALLINT * Supported);
  882. SQLRETURN SQL_API SQLGetInfo (
  883. SQLHDBC ConnectionHandle,
  884. SQLUSMALLINT InfoType,
  885. SQLPOINTER InfoValue,
  886. SQLSMALLINT BufferLength,
  887. SQLSMALLINT * StringLength);
  888. #if (ODBCVER >= 0x0300)
  889. SQLRETURN SQL_API SQLGetStmtAttr (
  890. SQLHSTMT StatementHandle,
  891. SQLINTEGER Attribute,
  892. SQLPOINTER Value,
  893. SQLINTEGER BufferLength,
  894. SQLINTEGER * StringLength);
  895. #endif /* ODBCVER >= 0x0300 */
  896. SQLRETURN SQL_API SQLGetStmtOption (
  897. SQLHSTMT StatementHandle,
  898. SQLUSMALLINT Option,
  899. SQLPOINTER Value);
  900. SQLRETURN SQL_API SQLGetTypeInfo (
  901. SQLHSTMT StatementHandle,
  902. SQLSMALLINT DataType);
  903. SQLRETURN SQL_API SQLNumResultCols (
  904. SQLHSTMT StatementHandle,
  905. SQLSMALLINT * ColumnCount);
  906. SQLRETURN SQL_API SQLParamData (
  907. SQLHSTMT StatementHandle,
  908. SQLPOINTER * Value);
  909. SQLRETURN SQL_API SQLPrepare (
  910. SQLHSTMT StatementHandle,
  911. SQLCHAR * StatementText,
  912. SQLINTEGER TextLength);
  913. SQLRETURN SQL_API SQLPutData (
  914. SQLHSTMT StatementHandle,
  915. SQLPOINTER Data,
  916. SQLLEN StrLen_or_Ind);
  917. SQLRETURN SQL_API SQLRowCount (
  918. SQLHSTMT StatementHandle,
  919. SQLLEN * RowCount);
  920. #if (ODBCVER >= 0x0300)
  921. SQLRETURN SQL_API SQLSetConnectAttr (
  922. SQLHDBC ConnectionHandle,
  923. SQLINTEGER Attribute,
  924. SQLPOINTER Value,
  925. SQLINTEGER StringLength);
  926. #endif /* ODBCVER >= 0x0300 */
  927. SQLRETURN SQL_API SQLSetConnectOption (
  928. SQLHDBC ConnectionHandle,
  929. SQLUSMALLINT Option,
  930. SQLULEN Value);
  931. SQLRETURN SQL_API SQLSetCursorName (
  932. SQLHSTMT StatementHandle,
  933. SQLCHAR * CursorName,
  934. SQLSMALLINT NameLength);
  935. #if (ODBCVER >= 0x0300)
  936. SQLRETURN SQL_API SQLSetDescField (
  937. SQLHDESC DescriptorHandle,
  938. SQLSMALLINT RecNumber,
  939. SQLSMALLINT FieldIdentifier,
  940. SQLPOINTER Value,
  941. SQLINTEGER BufferLength);
  942. SQLRETURN SQL_API SQLSetDescRec (
  943. SQLHDESC DescriptorHandle,
  944. SQLSMALLINT RecNumber,
  945. SQLSMALLINT Type,
  946. SQLSMALLINT SubType,
  947. SQLLEN Length,
  948. SQLSMALLINT Precision,
  949. SQLSMALLINT Scale,
  950. SQLPOINTER Data,
  951. SQLLEN * StringLength,
  952. SQLLEN * Indicator);
  953. SQLRETURN SQL_API SQLSetEnvAttr (
  954. SQLHENV EnvironmentHandle,
  955. SQLINTEGER Attribute,
  956. SQLPOINTER Value,
  957. SQLINTEGER StringLength);
  958. #endif /* ODBCVER >= 0x0300 */
  959. #if (ODBCVER >= 0x0300)
  960. SQLRETURN SQL_API SQLSetStmtAttr (
  961. SQLHSTMT StatementHandle,
  962. SQLINTEGER Attribute,
  963. SQLPOINTER Value,
  964. SQLINTEGER StringLength);
  965. #endif
  966. SQLRETURN SQL_API SQLSetStmtOption (
  967. SQLHSTMT StatementHandle,
  968. SQLUSMALLINT Option,
  969. SQLULEN Value);
  970. SQLRETURN SQL_API SQLSpecialColumns (
  971. SQLHSTMT StatementHandle,
  972. SQLUSMALLINT IdentifierType,
  973. SQLCHAR * CatalogName,
  974. SQLSMALLINT NameLength1,
  975. SQLCHAR * SchemaName,
  976. SQLSMALLINT NameLength2,
  977. SQLCHAR * TableName,
  978. SQLSMALLINT NameLength3,
  979. SQLUSMALLINT Scope,
  980. SQLUSMALLINT Nullable);
  981. SQLRETURN SQL_API SQLStatistics (
  982. SQLHSTMT StatementHandle,
  983. SQLCHAR * CatalogName,
  984. SQLSMALLINT NameLength1,
  985. SQLCHAR * SchemaName,
  986. SQLSMALLINT NameLength2,
  987. SQLCHAR * TableName,
  988. SQLSMALLINT NameLength3,
  989. SQLUSMALLINT Unique,
  990. SQLUSMALLINT Reserved);
  991. SQLRETURN SQL_API SQLTables (
  992. SQLHSTMT StatementHandle,
  993. SQLCHAR * CatalogName,
  994. SQLSMALLINT NameLength1,
  995. SQLCHAR * SchemaName,
  996. SQLSMALLINT NameLength2,
  997. SQLCHAR * TableName,
  998. SQLSMALLINT NameLength3,
  999. SQLCHAR * TableType,
  1000. SQLSMALLINT NameLength4);
  1001. SQLRETURN SQL_API SQLTransact (
  1002. SQLHENV EnvironmentHandle,
  1003. SQLHDBC ConnectionHandle,
  1004. SQLUSMALLINT CompletionType);
  1005. /*
  1006. * Depreciated ODBC 1.0 function - Use SQLBindParameter
  1007. */
  1008. SQLRETURN SQL_API SQLSetParam (
  1009. SQLHSTMT StatementHandle,
  1010. SQLUSMALLINT ParameterNumber,
  1011. SQLSMALLINT ValueType,
  1012. SQLSMALLINT ParameterType,
  1013. SQLULEN LengthPrecision,
  1014. SQLSMALLINT ParameterScale,
  1015. SQLPOINTER ParameterValue,
  1016. SQLLEN * StrLen_or_Ind);
  1017. #ifdef __cplusplus
  1018. }
  1019. #endif
  1020. #endif /* _SQL_H */