├── README.md ├── license.txt ├── SECURITY.md ├── contribution-agreement.md └── Windows └── inc ├── sqltypes.h ├── sqlucode.h ├── sql.h └── sqlext.h /README.md: -------------------------------------------------------------------------------- 1 | # Microsoft ODBC 4.0 Specification 2 | 3 | ## Introduction 4 | Microsoft ODBC is a widely adopted, standard, client-side API for accessing data. 5 | 6 | Microsoft ODBC version 4.0 is a new version of ODBC for modern data sources that adds support for features such as: 7 | * Private drivers 8 | * Additional capability reporting 9 | * Language extensions through additional SQL Escape Clauses 10 | * Semi-structured data – Tables whose schema may not be defined or may change on a row-by-row basis 11 | * Hierarchical Data – Data with nested structure (structured fields, lists) 12 | * Web Authentication model 13 | 14 | 15 | ## Contributing to Microsoft ODBC Specification 16 | Contributions to the Microsoft ODBC Specification are welcome and encouraged. 17 | 18 | **IMPORTANT** By participating in this project you agree to abide by the terms of the [Contribution Agreement][contribution-agreement]. 19 | 20 | 21 | [contribution-agreement]: https://github.com/Microsoft/ODBC-Specification/blob/master/contribution-agreement.md 22 | 23 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | ---- 2 | ODBC Specification 3 | 4 | Copyright (c) Microsoft Corporation 5 | 6 | All rights reserved. 7 | 8 | MIT License 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | ---- 17 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /contribution-agreement.md: -------------------------------------------------------------------------------- 1 | # ODBC 4.0 Specification Contribution License Agreement 2 | The Microsoft ODBC 4.0 Specification Project welcomes input. By participating in project you agree to the following: 3 | 4 | ##1.1 Definitions. 5 | A. “**You**” means the individual executing this Agreement. 6 | 7 | B. “**Entity**” means (1) Your principal, sponsor, or employer and (2) its Affiliates (i.e., entities that control, are controlled by, or are under common control with that principal, sponsor, or employer). If Your principal, sponsor, or employer changes, You must secure permission from the new entity and sign a new Agreement before making further Contributions. 8 | 9 | C. “**Microsoft**” means Microsoft Corporation and its affiliates and licensees. 10 | 11 | D. “**Project**” means the following computer architecture, software, specifications, and documentation owned or managed by Microsoft: 12 | 13 | 1. Microsoft ODBC 4.0 Specification, an incremental update to the ODBC Programmers Reference and associated Driver Manager, Installer, configuration utility, header files, samples, SDK, and related components. 14 | 15 | E. "**Contribution**" means any proposal, suggestion, work of authorship, or other verbal submission (including oral contributions if also reduced to writing) made by You or Entity in any form to Microsoft or its representatives regarding a Project, unless conspicuously identified in writing in advance as “Not a Contribution” before or at the time of the communication. 16 | 17 | ##1.2 Use Rights. 18 | Contributions may be used by Microsoft for any purpose relating to the Project to which the Contribution was submitted. 19 | 20 | ##1.3 Representations. 21 | You represent that (1) You are authorized to make this Agreement and legally entitled to grant the licenses on Your own behalf and on behalf of Entity, and (2) except for patents that are subject to the Patent License Grant below, at the time each Contribution is made You will identify to Microsoft in writing any patent that (a) You believe might be infringed by use or implementation of the Contribution or (b) to Your knowledge others have asserted might be infringed by use or implementation of the Contribution. 22 | 23 | ##1.4 Warranties. 24 | You and Entity warrant that You and/or Entity own the copyright in each Contribution or otherwise have sufficient rights under copyright to make each Contribution (in which case You must identify each owner and provide details of any third-party license or other restriction of which You are aware) under the following Copyright License Grant. 25 | 26 | ##1.5 Copyright License Grant. 27 | You and Entity hereby grant to Microsoft a non-exclusive, transferable, worldwide, perpetual, irrevocable, sublicensable, fee- and royalty-free copyright license to disclose, reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Contributions. 28 | 29 | ##1.6 Patent License Grant. 30 | With respect to patent claims owned or licensable by You or Entity that are necessarily infringed by use or implementation of any Contribution, You and Entity hereby grant to Microsoft and implementers of the Project and derivative works thereof a perpetual, irrevocable (except as set forth below), non-exclusive, worldwide, fee- and royalty-free patent license to use, make, have made, offer to sell, sell, distribute, import, and otherwise transfer products and services that use or implement the Contribution; provided, however, that 31 | (1) the licensing obligations do not apply if the sublicensing of patents requires that You or Entity pay patent license fees or royalties to an unaffiliated third party, or the patents are subject to an exclusive license, and (2) any patent licenses granted pursuant to this Agreement terminate, as of the date litigation is filed, as to any entity that institutes, joins, or financially supports litigation seeking damages or injunctive relief based on claims that use or implementation of a Contribution, or the Project to which such Contribution was made, constitutes direct, indirect, or contributory patent infringement. 32 | 33 | ##1.7 Other Rights Reserved. 34 | Each party reserves all rights not expressly granted in this Agreement. No rights are granted by implication, exhaustion, estoppel, or otherwise. 35 | 36 | ##1.8 Updates. 37 | You agree to notify Microsoft in writing of any facts or circumstances of which You become aware that would make Your representations in this Agreement inaccurate in any respect. 38 | 39 | ##1.9 Public Information. 40 | You agree that contributions to Projects and information about Contributions may be maintained indefinitely and disclosed publicly, including Your name, Entity’s name, and other information relating to Your Contributions. 41 | 42 | ##1.10 Entire Agreement/Assignment. 43 | This Agreement is the entire agreement between the parties, and supersedes any and all prior agreements, understandings or communications, written or oral, between the parties relating to the subject matter hereof. This Agreement may be assigned by Microsoft. 44 | 45 | -------------------------------------------------------------------------------- /Windows/inc/sqltypes.h: -------------------------------------------------------------------------------- 1 | /******************************************************** 2 | * * 3 | * Copyright (C) Microsoft. All rights reserved. * 4 | * * 5 | ********************************************************/ 6 | 7 | //----------------------------------------------------------------------------- 8 | // File: sqltypes.h 9 | // 10 | // Contents: This file defines the types used in ODBC 11 | // 12 | // Comments: 13 | // 14 | //----------------------------------------------------------------------------- 15 | 16 | #if defined(_MSC_VER) && (_MSC_VER > 1000) 17 | #pragma once 18 | #endif 19 | 20 | #ifndef __SQLTYPES 21 | #define __SQLTYPES 22 | 23 | #include 24 | 25 | #pragma region Desktop Family 26 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 27 | 28 | 29 | /* if ODBCVER is not defined, default to ODBC 3.80 */ 30 | #ifndef ODBCVER 31 | #define ODBCVER 0x0380 32 | #endif /* ODBCVER */ 33 | 34 | #ifdef __cplusplus 35 | extern "C" { /* Assume C declarations for C++ */ 36 | #endif /* __cplusplus */ 37 | 38 | /* environment specific definitions */ 39 | #ifndef EXPORT 40 | #define EXPORT 41 | #endif 42 | 43 | #ifdef WIN32 44 | #define SQL_API __stdcall 45 | #else 46 | #define SQL_API 47 | #endif 48 | 49 | #ifndef RC_INVOKED 50 | 51 | /* API declaration data types */ 52 | typedef unsigned char SQLCHAR; 53 | #if (ODBCVER >= 0x0300) 54 | typedef signed char SQLSCHAR; 55 | typedef unsigned char SQLDATE; 56 | typedef unsigned char SQLDECIMAL; 57 | typedef double SQLDOUBLE; 58 | typedef double SQLFLOAT; 59 | #endif 60 | typedef long SQLINTEGER; 61 | typedef unsigned long SQLUINTEGER; 62 | 63 | #ifdef _WIN64 64 | typedef INT64 SQLLEN; 65 | typedef UINT64 SQLULEN; 66 | typedef UINT64 SQLSETPOSIROW; 67 | #else 68 | #define SQLLEN SQLINTEGER 69 | #define SQLULEN SQLUINTEGER 70 | #define SQLSETPOSIROW SQLUSMALLINT 71 | #endif 72 | 73 | //For Backward compatibility 74 | #ifdef WIN32 75 | typedef SQLULEN SQLROWCOUNT; 76 | typedef SQLULEN SQLROWSETSIZE; 77 | typedef SQLULEN SQLTRANSID; 78 | typedef SQLLEN SQLROWOFFSET; 79 | #endif 80 | 81 | #if (ODBCVER >= 0x0300) 82 | typedef unsigned char SQLNUMERIC; 83 | #endif 84 | typedef void * SQLPOINTER; 85 | #if (ODBCVER >= 0x0300) 86 | typedef float SQLREAL; 87 | #endif 88 | typedef short SQLSMALLINT; 89 | typedef unsigned short SQLUSMALLINT; 90 | #if (ODBCVER >= 0x0300) 91 | typedef unsigned char SQLTIME; 92 | typedef unsigned char SQLTIMESTAMP; 93 | typedef unsigned char SQLVARCHAR; 94 | #endif 95 | #if (ODBCVER >= 0x0400) 96 | typedef unsigned char SQLTIMEWITHTIMEZONE; 97 | typedef unsigned char SQLTIMESTAMPWITHTIMEZONE; 98 | #endif /* ODBCVER >= 0x0400 */ 99 | 100 | /* function return type */ 101 | typedef SQLSMALLINT SQLRETURN; 102 | 103 | /* generic data structures */ 104 | #if (ODBCVER >= 0x0300) 105 | #if defined(WIN32) || defined(_WIN64) 106 | typedef void* SQLHANDLE; 107 | #else 108 | typedef SQLINTEGER SQLHANDLE; 109 | #endif /* defined(WIN32) || defined(_WIN64) */ 110 | typedef SQLHANDLE SQLHENV; 111 | typedef SQLHANDLE SQLHDBC; 112 | typedef SQLHANDLE SQLHSTMT; 113 | typedef SQLHANDLE SQLHDESC; 114 | #else //ODBCVER < 0x0300 115 | #if defined(WIN32) || defined(_WIN64) 116 | typedef void* SQLHENV; 117 | typedef void* SQLHDBC; 118 | typedef void* SQLHSTMT; 119 | #else 120 | typedef SQLINTEGER SQLHENV; 121 | typedef SQLINTEGER SQLHDBC; 122 | typedef SQLINTEGER SQLHSTMT; 123 | #endif /* defined(WIN32) || defined(_WIN64) */ 124 | #endif /* ODBCVER >= 0x0300 */ 125 | 126 | /* SQL portable types for C */ 127 | typedef unsigned char UCHAR; 128 | typedef signed char SCHAR; 129 | typedef SCHAR SQLSCHAR; 130 | typedef long int SDWORD; 131 | typedef short int SWORD; 132 | typedef unsigned long int UDWORD; 133 | typedef unsigned short int UWORD; 134 | #ifndef _WIN64 135 | typedef UDWORD SQLUINTEGER; 136 | #endif 137 | 138 | typedef signed long SLONG; 139 | typedef signed short SSHORT; 140 | typedef unsigned long ULONG; 141 | typedef unsigned short USHORT; 142 | typedef double SDOUBLE; 143 | typedef double LDOUBLE; 144 | typedef float SFLOAT; 145 | 146 | typedef void* PTR; 147 | 148 | typedef void* HENV; 149 | typedef void* HDBC; 150 | typedef void* HSTMT; 151 | 152 | typedef signed short RETCODE; 153 | 154 | #if defined(WIN32) || defined(OS2) 155 | typedef HWND SQLHWND; 156 | #elif defined (UNIX) 157 | typedef Widget SQLHWND; 158 | #else 159 | /* placehold for future O/S GUI window handle definition */ 160 | typedef SQLPOINTER SQLHWND; 161 | #endif 162 | 163 | #ifndef __SQLDATE 164 | #define __SQLDATE 165 | /* transfer types for DATE, TIME, TIMESTAMP */ 166 | typedef struct tagDATE_STRUCT 167 | { 168 | SQLSMALLINT year; 169 | SQLUSMALLINT month; 170 | SQLUSMALLINT day; 171 | } DATE_STRUCT; 172 | 173 | #if (ODBCVER >= 0x0300) 174 | typedef DATE_STRUCT SQL_DATE_STRUCT; 175 | #endif /* ODBCVER >= 0x0300 */ 176 | 177 | typedef struct tagTIME_STRUCT 178 | { 179 | SQLUSMALLINT hour; 180 | SQLUSMALLINT minute; 181 | SQLUSMALLINT second; 182 | } TIME_STRUCT; 183 | 184 | #if (ODBCVER >= 0x0300) 185 | typedef TIME_STRUCT SQL_TIME_STRUCT; 186 | #endif /* ODBCVER >= 0x0300 */ 187 | 188 | typedef struct tagTIMESTAMP_STRUCT 189 | { 190 | SQLSMALLINT year; 191 | SQLUSMALLINT month; 192 | SQLUSMALLINT day; 193 | SQLUSMALLINT hour; 194 | SQLUSMALLINT minute; 195 | SQLUSMALLINT second; 196 | SQLUINTEGER fraction; 197 | } TIMESTAMP_STRUCT; 198 | 199 | #if (ODBCVER >= 0x0300) 200 | typedef TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT; 201 | #endif /* ODBCVER >= 0x0300 */ 202 | 203 | typedef struct tagTIME_WITH_TIMEZONE_STRUCT 204 | { 205 | SQLUSMALLINT hour; 206 | SQLUSMALLINT minute; 207 | SQLUSMALLINT second; 208 | SQLSMALLINT timezone_hours; 209 | SQLUSMALLINT timezone_minutes; 210 | } TIME_WITH_TIMEZONE_STRUCT; 211 | 212 | #if (ODBCVER >= 0x0400) 213 | typedef TIME_WITH_TIMEZONE_STRUCT SQL_TIME_WITH_TIMEZONE_STRUCT; 214 | #endif /* ODBCVER >= 0x0400 */ 215 | 216 | typedef struct tagTIMESTAMP_WITH_TIMEZONE_STRUCT 217 | { 218 | SQLSMALLINT year; 219 | SQLUSMALLINT month; 220 | SQLUSMALLINT day; 221 | SQLUSMALLINT hour; 222 | SQLUSMALLINT minute; 223 | SQLUSMALLINT second; 224 | SQLUINTEGER fraction; 225 | SQLSMALLINT timezone_hours; 226 | SQLUSMALLINT timezone_minutes; 227 | } TIMESTAMP_WITH_TIMEZONE_STRUCT; 228 | 229 | #if (ODBCVER >= 0x0400) 230 | typedef TIMESTAMP_WITH_TIMEZONE_STRUCT SQL_TIMESTAMP_WITH_TIMEZONE_STRUCT; 231 | #endif /* ODBCVER >= 0x0400 */ 232 | 233 | /* 234 | * enumerations for DATETIME_INTERVAL_SUBCODE values for interval data types 235 | * these values are from SQL-92 236 | */ 237 | 238 | #if (ODBCVER >= 0x0300) 239 | typedef enum 240 | { 241 | SQL_IS_YEAR = 1, 242 | SQL_IS_MONTH = 2, 243 | SQL_IS_DAY = 3, 244 | SQL_IS_HOUR = 4, 245 | SQL_IS_MINUTE = 5, 246 | SQL_IS_SECOND = 6, 247 | SQL_IS_YEAR_TO_MONTH = 7, 248 | SQL_IS_DAY_TO_HOUR = 8, 249 | SQL_IS_DAY_TO_MINUTE = 9, 250 | SQL_IS_DAY_TO_SECOND = 10, 251 | SQL_IS_HOUR_TO_MINUTE = 11, 252 | SQL_IS_HOUR_TO_SECOND = 12, 253 | SQL_IS_MINUTE_TO_SECOND = 13 254 | } SQLINTERVAL; 255 | 256 | #endif /* ODBCVER >= 0x0300 */ 257 | 258 | #if (ODBCVER >= 0x0300) 259 | typedef struct tagSQL_YEAR_MONTH 260 | { 261 | SQLUINTEGER year; 262 | SQLUINTEGER month; 263 | } SQL_YEAR_MONTH_STRUCT; 264 | 265 | typedef struct tagSQL_DAY_SECOND 266 | { 267 | SQLUINTEGER day; 268 | SQLUINTEGER hour; 269 | SQLUINTEGER minute; 270 | SQLUINTEGER second; 271 | SQLUINTEGER fraction; 272 | } SQL_DAY_SECOND_STRUCT; 273 | 274 | typedef struct tagSQL_INTERVAL_STRUCT 275 | { 276 | SQLINTERVAL interval_type; 277 | SQLSMALLINT interval_sign; 278 | union { 279 | SQL_YEAR_MONTH_STRUCT year_month; 280 | SQL_DAY_SECOND_STRUCT day_second; 281 | } intval; 282 | 283 | } SQL_INTERVAL_STRUCT; 284 | 285 | #endif /* ODBCVER >= 0x0300 */ 286 | 287 | #endif /* __SQLDATE */ 288 | 289 | /* the ODBC C types for SQL_C_SBIGINT and SQL_C_UBIGINT */ 290 | #if (ODBCVER >= 0x0300) 291 | #if (_MSC_VER >= 900) 292 | #define ODBCINT64 __int64 293 | #endif 294 | 295 | /* If using other compilers, define ODBCINT64 to the 296 | approriate 64 bit integer type */ 297 | #ifdef ODBCINT64 298 | typedef ODBCINT64 SQLBIGINT; 299 | typedef unsigned ODBCINT64 SQLUBIGINT; 300 | #endif 301 | #endif /* ODBCVER >= 0x0300 */ 302 | 303 | /* internal representation of numeric data type */ 304 | #if (ODBCVER >= 0x0300) 305 | #define SQL_MAX_NUMERIC_LEN 16 306 | typedef struct tagSQL_NUMERIC_STRUCT 307 | { 308 | SQLCHAR precision; 309 | SQLSCHAR scale; 310 | SQLCHAR sign; /* 1 if positive, 0 if negative */ 311 | SQLCHAR val[SQL_MAX_NUMERIC_LEN]; 312 | } SQL_NUMERIC_STRUCT; 313 | #endif /* ODBCVER >= 0x0300 */ 314 | 315 | #if (ODBCVER >= 0x0350) 316 | #ifdef GUID_DEFINED 317 | typedef GUID SQLGUID; 318 | #else 319 | /* size is 16 */ 320 | typedef struct tagSQLGUID 321 | { 322 | DWORD Data1; 323 | WORD Data2; 324 | WORD Data3; 325 | BYTE Data4[ 8 ]; 326 | } SQLGUID; 327 | #endif /* GUID_DEFINED */ 328 | #endif /* ODBCVER >= 0x0350 */ 329 | 330 | typedef SQLULEN BOOKMARK; 331 | 332 | #ifdef _WCHAR_T_DEFINED 333 | typedef wchar_t SQLWCHAR; 334 | #else 335 | typedef unsigned short SQLWCHAR; 336 | #endif 337 | 338 | #ifdef UNICODE 339 | typedef SQLWCHAR SQLTCHAR; 340 | #else 341 | typedef SQLCHAR SQLTCHAR; 342 | #endif /* UNICODE */ 343 | 344 | 345 | #endif /* RC_INVOKED */ 346 | 347 | 348 | #ifdef __cplusplus 349 | } /* End of extern "C" { */ 350 | #endif /* __cplusplus */ 351 | 352 | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ 353 | #pragma endregion 354 | 355 | #endif /* #ifndef __SQLTYPES */ 356 | -------------------------------------------------------------------------------- /Windows/inc/sqlucode.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // File: sqlucode.h 3 | // 4 | // Copyright: Copyright (c) Microsoft Corporation 5 | // 6 | // Contents: This is the the unicode include for ODBC Core functions 7 | // 8 | // Comments: 9 | // 10 | //----------------------------------------------------------------------------- 11 | 12 | #ifndef __SQLUCODE 13 | #define __SQLUCODE 14 | 15 | #include 16 | 17 | #pragma region Desktop Family 18 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { /* Assume C declarations for C++ */ 23 | #endif /* __cplusplus */ 24 | 25 | #include 26 | 27 | #define SQL_WCHAR (-8) 28 | #define SQL_WVARCHAR (-9) 29 | #define SQL_WLONGVARCHAR (-10) 30 | #define SQL_C_WCHAR SQL_WCHAR 31 | 32 | #ifdef UNICODE 33 | #define SQL_C_TCHAR SQL_C_WCHAR 34 | #else 35 | #define SQL_C_TCHAR SQL_C_CHAR 36 | #endif 37 | 38 | #define SQL_SQLSTATE_SIZEW 10 /* size of SQLSTATE for unicode */ 39 | 40 | #ifndef RC_INVOKED 41 | 42 | // UNICODE versions 43 | #ifdef _WIN64 44 | SQLRETURN SQL_API SQLColAttributeW 45 | ( 46 | SQLHSTMT hstmt, 47 | SQLUSMALLINT iCol, 48 | SQLUSMALLINT iField, 49 | _Out_writes_bytes_opt_(cbDescMax) 50 | SQLPOINTER pCharAttr, 51 | SQLSMALLINT cbDescMax, 52 | _Out_opt_ 53 | SQLSMALLINT *pcbCharAttr, 54 | _Out_opt_ 55 | SQLLEN *pNumAttr 56 | ); 57 | #else 58 | SQLRETURN SQL_API SQLColAttributeW( 59 | SQLHSTMT hstmt, 60 | SQLUSMALLINT iCol, 61 | SQLUSMALLINT iField, 62 | _Out_writes_bytes_opt_(cbDescMax) 63 | SQLPOINTER pCharAttr, 64 | SQLSMALLINT cbDescMax, 65 | _Out_opt_ 66 | SQLSMALLINT *pcbCharAttr, 67 | _Out_opt_ 68 | SQLPOINTER pNumAttr); 69 | #endif 70 | 71 | SQLRETURN SQL_API SQLColAttributesW 72 | ( 73 | SQLHSTMT hstmt, 74 | SQLUSMALLINT icol, 75 | SQLUSMALLINT fDescType, 76 | _Out_writes_bytes_opt_(cbDescMax) 77 | SQLPOINTER rgbDesc, 78 | SQLSMALLINT cbDescMax, 79 | _Out_opt_ 80 | SQLSMALLINT *pcbDesc, 81 | _Out_opt_ 82 | SQLLEN *pfDesc 83 | ); 84 | 85 | SQLRETURN SQL_API SQLConnectW 86 | ( 87 | SQLHDBC hdbc, 88 | _In_reads_(cchDSN) SQLWCHAR* szDSN, 89 | SQLSMALLINT cchDSN, 90 | _In_reads_(cchUID) SQLWCHAR* szUID, 91 | SQLSMALLINT cchUID, 92 | _In_reads_(cchAuthStr) SQLWCHAR* szAuthStr, 93 | SQLSMALLINT cchAuthStr 94 | ); 95 | 96 | SQLRETURN SQL_API SQLDescribeColW 97 | ( 98 | SQLHSTMT hstmt, 99 | SQLUSMALLINT icol, 100 | _Out_writes_opt_(cchColNameMax) SQLWCHAR* szColName, 101 | SQLSMALLINT cchColNameMax, 102 | _Out_opt_ 103 | SQLSMALLINT* pcchColName, 104 | _Out_opt_ 105 | SQLSMALLINT* pfSqlType, 106 | _Out_opt_ 107 | SQLULEN* pcbColDef, 108 | _Out_opt_ 109 | SQLSMALLINT* pibScale, 110 | _Out_opt_ 111 | SQLSMALLINT* pfNullable 112 | ); 113 | 114 | SQLRETURN SQL_API SQLErrorW 115 | ( 116 | SQLHENV henv, 117 | SQLHDBC hdbc, 118 | SQLHSTMT hstmt, 119 | _Out_writes_(6) SQLWCHAR* wszSqlState, 120 | _Out_opt_ SQLINTEGER* pfNativeError, 121 | _Out_writes_opt_(cchErrorMsgMax) SQLWCHAR* wszErrorMsg, 122 | SQLSMALLINT cchErrorMsgMax, 123 | _Out_opt_ SQLSMALLINT* pcchErrorMsg 124 | ); 125 | 126 | SQLRETURN SQL_API SQLExecDirectW 127 | ( 128 | SQLHSTMT hstmt, 129 | _In_reads_opt_(TextLength) SQLWCHAR* szSqlStr, 130 | SQLINTEGER TextLength 131 | ); 132 | 133 | SQLRETURN SQL_API SQLGetConnectAttrW 134 | ( 135 | SQLHDBC hdbc, 136 | SQLINTEGER fAttribute, 137 | _Out_writes_opt_(_Inexpressible_(cbValueMax)) 138 | SQLPOINTER rgbValue, 139 | SQLINTEGER cbValueMax, 140 | _Out_opt_ 141 | SQLINTEGER* pcbValue 142 | ); 143 | 144 | SQLRETURN SQL_API SQLGetCursorNameW 145 | ( 146 | SQLHSTMT hstmt, 147 | _Out_writes_opt_(cchCursorMax) SQLWCHAR* szCursor, 148 | SQLSMALLINT cchCursorMax, 149 | _Out_opt_ 150 | SQLSMALLINT* pcchCursor 151 | ); 152 | 153 | #if (ODBCVER >= 0x0300) 154 | SQLRETURN SQL_API SQLSetDescFieldW 155 | ( 156 | SQLHDESC DescriptorHandle, 157 | SQLSMALLINT RecNumber, 158 | SQLSMALLINT FieldIdentifier, 159 | SQLPOINTER Value, 160 | SQLINTEGER BufferLength 161 | ); 162 | 163 | SQLRETURN SQL_API SQLGetDescFieldW 164 | ( 165 | SQLHDESC hdesc, 166 | SQLSMALLINT iRecord, 167 | SQLSMALLINT iField, 168 | _Out_writes_opt_(_Inexpressible_(cbBufferLength)) 169 | SQLPOINTER rgbValue, 170 | SQLINTEGER cbBufferLength, 171 | _Out_opt_ 172 | SQLINTEGER *StringLength 173 | ); 174 | 175 | SQLRETURN SQL_API SQLGetDescRecW 176 | ( 177 | SQLHDESC hdesc, 178 | SQLSMALLINT iRecord, 179 | _Out_writes_opt_(cchNameMax) SQLWCHAR* szName, 180 | SQLSMALLINT cchNameMax, 181 | _Out_opt_ 182 | SQLSMALLINT *pcchName, 183 | _Out_opt_ 184 | SQLSMALLINT *pfType, 185 | _Out_opt_ 186 | SQLSMALLINT *pfSubType, 187 | _Out_opt_ 188 | SQLLEN *pLength, 189 | _Out_opt_ 190 | SQLSMALLINT *pPrecision, 191 | _Out_opt_ 192 | SQLSMALLINT *pScale, 193 | _Out_opt_ 194 | SQLSMALLINT *pNullable 195 | ); 196 | 197 | SQLRETURN SQL_API SQLGetDiagFieldW 198 | ( 199 | SQLSMALLINT fHandleType, 200 | SQLHANDLE handle, 201 | SQLSMALLINT iRecord, 202 | SQLSMALLINT fDiagField, 203 | _Out_writes_opt_(_Inexpressible_(cbBufferLength)) 204 | SQLPOINTER rgbDiagInfo, 205 | SQLSMALLINT cbBufferLength, 206 | _Out_opt_ 207 | SQLSMALLINT *pcbStringLength 208 | ); 209 | 210 | SQLRETURN SQL_API SQLGetDiagRecW 211 | ( 212 | SQLSMALLINT fHandleType, 213 | SQLHANDLE handle, 214 | SQLSMALLINT iRecord, 215 | _Out_writes_opt_(6) SQLWCHAR* szSqlState, 216 | SQLINTEGER* pfNativeError, 217 | _Out_writes_opt_(cchErrorMsgMax) SQLWCHAR* szErrorMsg, 218 | SQLSMALLINT cchErrorMsgMax, 219 | SQLSMALLINT* pcchErrorMsg 220 | ); 221 | #endif 222 | 223 | SQLRETURN SQL_API SQLPrepareW 224 | ( 225 | SQLHSTMT hstmt, 226 | _In_reads_(cchSqlStr) SQLWCHAR* szSqlStr, 227 | SQLINTEGER cchSqlStr 228 | ); 229 | 230 | SQLRETURN SQL_API SQLSetConnectAttrW( 231 | SQLHDBC hdbc, 232 | SQLINTEGER fAttribute, 233 | _In_reads_bytes_opt_(cbValue) 234 | SQLPOINTER rgbValue, 235 | SQLINTEGER cbValue); 236 | 237 | SQLRETURN SQL_API SQLSetCursorNameW 238 | ( 239 | SQLHSTMT hstmt, 240 | _In_reads_(cchCursor) SQLWCHAR* szCursor, 241 | SQLSMALLINT cchCursor 242 | ); 243 | 244 | SQLRETURN SQL_API SQLColumnsW 245 | ( 246 | SQLHSTMT hstmt, 247 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 248 | SQLSMALLINT cchCatalogName, 249 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 250 | SQLSMALLINT cchSchemaName, 251 | _In_reads_opt_(cchTableName) SQLWCHAR* szTableName, 252 | SQLSMALLINT cchTableName, 253 | _In_reads_opt_(cchColumnName) SQLWCHAR* szColumnName, 254 | SQLSMALLINT cchColumnName 255 | ); 256 | 257 | SQLRETURN SQL_API SQLGetConnectOptionW( 258 | SQLHDBC hdbc, 259 | SQLUSMALLINT fOption, 260 | SQLPOINTER pvParam); 261 | 262 | SQLRETURN SQL_API SQLGetInfoW( 263 | SQLHDBC hdbc, 264 | SQLUSMALLINT fInfoType, 265 | _Out_writes_bytes_opt_(cbInfoValueMax) SQLPOINTER rgbInfoValue, 266 | SQLSMALLINT cbInfoValueMax, 267 | _Out_opt_ 268 | SQLSMALLINT* pcbInfoValue); 269 | 270 | SQLRETURN SQL_API SQLGetTypeInfoW( 271 | SQLHSTMT StatementHandle, 272 | SQLSMALLINT DataType); 273 | 274 | SQLRETURN SQL_API SQLSetConnectOptionW( 275 | SQLHDBC hdbc, 276 | SQLUSMALLINT fOption, 277 | SQLULEN vParam); 278 | 279 | SQLRETURN SQL_API SQLSpecialColumnsW 280 | ( 281 | SQLHSTMT hstmt, 282 | SQLUSMALLINT fColType, 283 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 284 | SQLSMALLINT cchCatalogName, 285 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 286 | SQLSMALLINT cchSchemaName, 287 | _In_reads_opt_(cchTableName) SQLWCHAR* szTableName, 288 | SQLSMALLINT cchTableName, 289 | SQLUSMALLINT fScope, 290 | SQLUSMALLINT fNullable 291 | ); 292 | 293 | SQLRETURN SQL_API SQLStatisticsW 294 | ( 295 | SQLHSTMT hstmt, 296 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 297 | SQLSMALLINT cchCatalogName, 298 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 299 | SQLSMALLINT cchSchemaName, 300 | _In_reads_opt_(cchTableName) SQLWCHAR* szTableName, 301 | SQLSMALLINT cchTableName, 302 | SQLUSMALLINT fUnique, 303 | SQLUSMALLINT fAccuracy 304 | ); 305 | 306 | SQLRETURN SQL_API SQLTablesW 307 | ( 308 | SQLHSTMT hstmt, 309 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 310 | SQLSMALLINT cchCatalogName, 311 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 312 | SQLSMALLINT cchSchemaName, 313 | _In_reads_opt_(cchTableName) SQLWCHAR* szTableName, 314 | SQLSMALLINT cchTableName, 315 | _In_reads_opt_(cchTableType) SQLWCHAR* szTableType, 316 | SQLSMALLINT cchTableType 317 | ); 318 | 319 | SQLRETURN SQL_API SQLDataSourcesW 320 | ( 321 | SQLHENV henv, 322 | SQLUSMALLINT fDirection, 323 | _Out_writes_opt_(cchDSNMax) SQLWCHAR* szDSN, 324 | SQLSMALLINT cchDSNMax, 325 | _Out_opt_ 326 | SQLSMALLINT* pcchDSN, 327 | _Out_writes_opt_(cchDescriptionMax) SQLWCHAR* wszDescription, 328 | SQLSMALLINT cchDescriptionMax, 329 | _Out_opt_ 330 | SQLSMALLINT* pcchDescription 331 | ); 332 | 333 | SQLRETURN SQL_API SQLDriverConnectW 334 | ( 335 | SQLHDBC hdbc, 336 | SQLHWND hwnd, 337 | _In_reads_(cchConnStrIn) SQLWCHAR* szConnStrIn, 338 | SQLSMALLINT cchConnStrIn, 339 | _Out_writes_opt_(cchConnStrOutMax) SQLWCHAR* szConnStrOut, 340 | SQLSMALLINT cchConnStrOutMax, 341 | _Out_opt_ SQLSMALLINT* pcchConnStrOut, 342 | SQLUSMALLINT fDriverCompletion 343 | ); 344 | 345 | SQLRETURN SQL_API SQLBrowseConnectW 346 | ( 347 | SQLHDBC hdbc, 348 | _In_reads_(cchConnStrIn) SQLWCHAR* szConnStrIn, 349 | SQLSMALLINT cchConnStrIn, 350 | _Out_writes_opt_(cchConnStrOutMax) SQLWCHAR* szConnStrOut, 351 | SQLSMALLINT cchConnStrOutMax, 352 | _Out_opt_ 353 | SQLSMALLINT* pcchConnStrOut 354 | ); 355 | 356 | SQLRETURN SQL_API SQLColumnPrivilegesW( 357 | SQLHSTMT hstmt, 358 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 359 | SQLSMALLINT cchCatalogName, 360 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 361 | SQLSMALLINT cchSchemaName, 362 | _In_reads_opt_(cchTableName) SQLWCHAR* szTableName, 363 | SQLSMALLINT cchTableName, 364 | _In_reads_opt_(cchColumnName) SQLWCHAR* szColumnName, 365 | SQLSMALLINT cchColumnName 366 | ); 367 | 368 | SQLRETURN SQL_API SQLGetStmtAttrW( 369 | SQLHSTMT hstmt, 370 | SQLINTEGER fAttribute, 371 | SQLPOINTER rgbValue, 372 | SQLINTEGER cbValueMax, 373 | SQLINTEGER *pcbValue); 374 | 375 | SQLRETURN SQL_API SQLSetStmtAttrW( 376 | SQLHSTMT hstmt, 377 | SQLINTEGER fAttribute, 378 | SQLPOINTER rgbValue, 379 | SQLINTEGER cbValueMax); 380 | 381 | SQLRETURN SQL_API SQLForeignKeysW 382 | ( 383 | SQLHSTMT hstmt, 384 | _In_reads_opt_(cchPkCatalogName) SQLWCHAR* szPkCatalogName, 385 | SQLSMALLINT cchPkCatalogName, 386 | _In_reads_opt_(cchPkSchemaName) SQLWCHAR* szPkSchemaName, 387 | SQLSMALLINT cchPkSchemaName, 388 | _In_reads_opt_(cchPkTableName) SQLWCHAR* szPkTableName, 389 | SQLSMALLINT cchPkTableName, 390 | _In_reads_opt_(cchFkCatalogName) SQLWCHAR* szFkCatalogName, 391 | SQLSMALLINT cchFkCatalogName, 392 | _In_reads_opt_(cchFkSchemaName) SQLWCHAR* szFkSchemaName, 393 | SQLSMALLINT cchFkSchemaName, 394 | _In_reads_opt_(cchFkTableName) SQLWCHAR* szFkTableName, 395 | SQLSMALLINT cchFkTableName 396 | ); 397 | 398 | SQLRETURN SQL_API SQLNativeSqlW 399 | ( 400 | SQLHDBC hdbc, 401 | _In_reads_(cchSqlStrIn) SQLWCHAR* szSqlStrIn, 402 | SQLINTEGER cchSqlStrIn, 403 | _Out_writes_opt_(cchSqlStrMax) SQLWCHAR* szSqlStr, 404 | SQLINTEGER cchSqlStrMax, 405 | SQLINTEGER* pcchSqlStr 406 | ); 407 | 408 | SQLRETURN SQL_API SQLPrimaryKeysW 409 | ( 410 | SQLHSTMT hstmt, 411 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 412 | SQLSMALLINT cchCatalogName, 413 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 414 | SQLSMALLINT cchSchemaName, 415 | _In_reads_opt_(cchTableName) SQLWCHAR* szTableName, 416 | SQLSMALLINT cchTableName 417 | ); 418 | 419 | SQLRETURN SQL_API SQLProcedureColumnsW 420 | ( 421 | SQLHSTMT hstmt, 422 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 423 | SQLSMALLINT cchCatalogName, 424 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 425 | SQLSMALLINT cchSchemaName, 426 | _In_reads_opt_(cchProcName) SQLWCHAR* szProcName, 427 | SQLSMALLINT cchProcName, 428 | _In_reads_opt_(cchColumnName) SQLWCHAR* szColumnName, 429 | SQLSMALLINT cchColumnName 430 | ); 431 | 432 | SQLRETURN SQL_API SQLProceduresW 433 | ( 434 | SQLHSTMT hstmt, 435 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 436 | SQLSMALLINT cchCatalogName, 437 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 438 | SQLSMALLINT cchSchemaName, 439 | _In_reads_opt_(cchProcName) SQLWCHAR* szProcName, 440 | SQLSMALLINT cchProcName 441 | ); 442 | 443 | SQLRETURN SQL_API SQLTablePrivilegesW 444 | ( 445 | SQLHSTMT hstmt, 446 | _In_reads_opt_(cchCatalogName) SQLWCHAR* szCatalogName, 447 | SQLSMALLINT cchCatalogName, 448 | _In_reads_opt_(cchSchemaName) SQLWCHAR* szSchemaName, 449 | SQLSMALLINT cchSchemaName, 450 | _In_reads_opt_(cchTableName) SQLWCHAR* szTableName, 451 | SQLSMALLINT cchTableName 452 | ); 453 | 454 | SQLRETURN SQL_API SQLDriversW 455 | ( 456 | SQLHENV henv, 457 | SQLUSMALLINT fDirection, 458 | _Out_writes_opt_(cchDriverDescMax) SQLWCHAR* szDriverDesc, 459 | SQLSMALLINT cchDriverDescMax, 460 | _Out_opt_ 461 | SQLSMALLINT* pcchDriverDesc, 462 | _Out_writes_opt_(cchDrvrAttrMax) SQLWCHAR* szDriverAttributes, 463 | SQLSMALLINT cchDrvrAttrMax, 464 | _Out_opt_ 465 | SQLSMALLINT* pcchDrvrAttr 466 | ); 467 | 468 | #if (ODBCVER >= 0x0400) 469 | SQLRETURN SQL_API SQLStructuredTypesW( 470 | SQLHSTMT hstmt, 471 | _In_reads_opt_(cchCatalogName) SQLWCHAR *szCatalogName, 472 | SQLSMALLINT cchCatalogName, 473 | _In_reads_opt_(cchSchemaName) SQLWCHAR *szSchemaName, 474 | SQLSMALLINT cchSchemaName, 475 | _In_reads_opt_(cchTypeName) SQLWCHAR *szTypeName, 476 | SQLSMALLINT cchTypeName); 477 | 478 | SQLRETURN SQL_API SQLStructuredTypeColumnsW( 479 | SQLHSTMT hstmt, 480 | _In_reads_opt_(cchCatalogName) SQLWCHAR *szCatalogName, 481 | SQLSMALLINT cchCatalogName, 482 | _In_reads_opt_(cchSchemaName) SQLWCHAR *szSchemaName, 483 | SQLSMALLINT cchSchemaName, 484 | _In_reads_opt_(cchTypeName) SQLWCHAR *szTypeName, 485 | SQLSMALLINT cchTypeName, 486 | _In_reads_opt_(cchColumnName) SQLWCHAR *szColumnName, 487 | SQLSMALLINT cchColumnName); 488 | #endif /* ODBCVER >= 0x0400 */ 489 | 490 | // ANSI versions 491 | #ifdef _WIN64 492 | SQLRETURN SQL_API SQLColAttributeA( 493 | SQLHSTMT hstmt, 494 | SQLSMALLINT iCol, 495 | SQLSMALLINT iField, 496 | _Out_writes_bytes_opt_(cbCharAttrMax) 497 | SQLPOINTER pCharAttr, 498 | SQLSMALLINT cbCharAttrMax, 499 | _Out_opt_ 500 | SQLSMALLINT *pcbCharAttr, 501 | _Out_opt_ 502 | SQLLEN *pNumAttr); 503 | #else 504 | SQLRETURN SQL_API SQLColAttributeA( 505 | SQLHSTMT hstmt, 506 | SQLSMALLINT iCol, 507 | SQLSMALLINT iField, 508 | _Out_writes_bytes_opt_(cbCharAttrMax) 509 | SQLPOINTER pCharAttr, 510 | SQLSMALLINT cbCharAttrMax, 511 | _Out_opt_ 512 | SQLSMALLINT *pcbCharAttr, 513 | _Out_opt_ 514 | SQLPOINTER pNumAttr); 515 | #endif 516 | 517 | SQLRETURN SQL_API SQLColAttributesA( 518 | SQLHSTMT hstmt, 519 | SQLUSMALLINT icol, 520 | SQLUSMALLINT fDescType, 521 | _Out_writes_bytes_opt_(cbDescMax) 522 | SQLPOINTER rgbDesc, 523 | SQLSMALLINT cbDescMax, 524 | _Out_opt_ 525 | SQLSMALLINT *pcbDesc, 526 | _Out_opt_ 527 | SQLLEN *pfDesc); 528 | 529 | SQLRETURN SQL_API SQLConnectA( 530 | SQLHDBC hdbc, 531 | _In_reads_(cbDSN) 532 | SQLCHAR *szDSN, 533 | SQLSMALLINT cbDSN, 534 | _In_reads_(cbUID) 535 | SQLCHAR *szUID, 536 | SQLSMALLINT cbUID, 537 | _In_reads_(cbAuthStr) 538 | SQLCHAR *szAuthStr, 539 | SQLSMALLINT cbAuthStr); 540 | 541 | SQLRETURN SQL_API SQLDescribeColA( 542 | SQLHSTMT hstmt, 543 | SQLUSMALLINT icol, 544 | _Out_writes_opt_(cbColNameMax) 545 | SQLCHAR *szColName, 546 | SQLSMALLINT cbColNameMax, 547 | _Out_opt_ 548 | SQLSMALLINT *pcbColName, 549 | _Out_opt_ 550 | SQLSMALLINT *pfSqlType, 551 | _Out_opt_ 552 | SQLULEN *pcbColDef, 553 | _Out_opt_ 554 | SQLSMALLINT *pibScale, 555 | _Out_opt_ 556 | SQLSMALLINT *pfNullable); 557 | 558 | SQLRETURN SQL_API SQLErrorA( 559 | SQLHENV henv, 560 | SQLHDBC hdbc, 561 | SQLHSTMT hstmt, 562 | _Out_writes_(SQL_SQLSTATE_SIZE + 1) 563 | SQLCHAR *szSqlState, 564 | _Out_opt_ 565 | SQLINTEGER *pfNativeError, 566 | _Out_writes_opt_(cbErrorMsgMax) 567 | SQLCHAR *szErrorMsg, 568 | SQLSMALLINT cbErrorMsgMax, 569 | _Out_opt_ 570 | SQLSMALLINT *pcbErrorMsg); 571 | 572 | SQLRETURN SQL_API SQLExecDirectA( 573 | SQLHSTMT hstmt, 574 | _In_reads_opt_(cbSqlStr) 575 | SQLCHAR *szSqlStr, 576 | SQLINTEGER cbSqlStr); 577 | 578 | SQLRETURN SQL_API SQLGetConnectAttrA( 579 | SQLHDBC hdbc, 580 | SQLINTEGER fAttribute, 581 | _Out_writes_opt_(_Inexpressible_(cbValueMax)) 582 | SQLPOINTER rgbValue, 583 | SQLINTEGER cbValueMax, 584 | _Out_opt_ 585 | SQLINTEGER *pcbValue); 586 | 587 | SQLRETURN SQL_API SQLGetCursorNameA( 588 | SQLHSTMT hstmt, 589 | _Out_writes_opt_(cbCursorMax) 590 | SQLCHAR *szCursor, 591 | SQLSMALLINT cbCursorMax, 592 | _Out_opt_ 593 | SQLSMALLINT *pcbCursor); 594 | 595 | #if (ODBCVER >= 0x0300) 596 | SQLRETURN SQL_API SQLGetDescFieldA( 597 | SQLHDESC hdesc, 598 | SQLSMALLINT iRecord, 599 | SQLSMALLINT iField, 600 | _Out_writes_opt_(_Inexpressible_(cbBufferLength)) 601 | SQLPOINTER rgbValue, 602 | SQLINTEGER cbBufferLength, 603 | _Out_opt_ 604 | SQLINTEGER *StringLength); 605 | 606 | SQLRETURN SQL_API SQLGetDescRecA( 607 | SQLHDESC hdesc, 608 | SQLSMALLINT iRecord, 609 | _Out_writes_opt_(cbNameMax) 610 | SQLCHAR *szName, 611 | SQLSMALLINT cbNameMax, 612 | _Out_opt_ 613 | SQLSMALLINT *pcbName, 614 | _Out_opt_ 615 | SQLSMALLINT *pfType, 616 | _Out_opt_ 617 | SQLSMALLINT *pfSubType, 618 | _Out_opt_ 619 | SQLLEN *pLength, 620 | _Out_opt_ 621 | SQLSMALLINT *pPrecision, 622 | _Out_opt_ 623 | SQLSMALLINT *pScale, 624 | _Out_opt_ 625 | SQLSMALLINT *pNullable); 626 | 627 | SQLRETURN SQL_API SQLGetDiagFieldA( 628 | SQLSMALLINT fHandleType, 629 | SQLHANDLE handle, 630 | SQLSMALLINT iRecord, 631 | SQLSMALLINT fDiagField, 632 | _Out_writes_opt_(_Inexpressible_(cbDiagInfoMax)) 633 | SQLPOINTER rgbDiagInfo, 634 | SQLSMALLINT cbDiagInfoMax, 635 | _Out_opt_ 636 | SQLSMALLINT *pcbDiagInfo); 637 | 638 | SQLRETURN SQL_API SQLGetDiagRecA( 639 | SQLSMALLINT fHandleType, 640 | SQLHANDLE handle, 641 | SQLSMALLINT iRecord, 642 | _Out_writes_opt_(6) 643 | SQLCHAR *szSqlState, 644 | SQLINTEGER *pfNativeError, 645 | _Out_writes_opt_(cbErrorMsgMax) 646 | SQLCHAR *szErrorMsg, 647 | SQLSMALLINT cbErrorMsgMax, 648 | SQLSMALLINT *pcbErrorMsg); 649 | 650 | SQLRETURN SQL_API SQLGetStmtAttrA( 651 | SQLHSTMT hstmt, 652 | SQLINTEGER fAttribute, 653 | SQLPOINTER rgbValue, 654 | SQLINTEGER cbValueMax, 655 | SQLINTEGER *pcbValue); 656 | #endif 657 | 658 | SQLRETURN SQL_API SQLGetTypeInfoA( 659 | SQLHSTMT StatementHandle, 660 | SQLSMALLINT DataType); 661 | 662 | SQLRETURN SQL_API SQLPrepareA( 663 | SQLHSTMT hstmt, 664 | _In_reads_(cbSqlStr) 665 | SQLCHAR *szSqlStr, 666 | SQLINTEGER cbSqlStr); 667 | 668 | SQLRETURN SQL_API SQLSetConnectAttrA( 669 | SQLHDBC hdbc, 670 | SQLINTEGER fAttribute, 671 | _In_reads_bytes_opt_(cbValue) 672 | SQLPOINTER rgbValue, 673 | SQLINTEGER cbValue); 674 | 675 | SQLRETURN SQL_API SQLSetCursorNameA( 676 | SQLHSTMT hstmt, 677 | _In_reads_(cbCursor) 678 | SQLCHAR *szCursor, 679 | SQLSMALLINT cbCursor); 680 | 681 | SQLRETURN SQL_API SQLColumnsA( 682 | SQLHSTMT hstmt, 683 | _In_reads_opt_(cbCatalogName) 684 | SQLCHAR *szCatalogName, 685 | SQLSMALLINT cbCatalogName, 686 | _In_reads_opt_(cbSchemaName) 687 | SQLCHAR *szSchemaName, 688 | SQLSMALLINT cbSchemaName, 689 | _In_reads_opt_(cbTableName) 690 | SQLCHAR *szTableName, 691 | SQLSMALLINT cbTableName, 692 | _In_reads_opt_(cbColumnName) 693 | SQLCHAR *szColumnName, 694 | SQLSMALLINT cbColumnName); 695 | 696 | SQLRETURN SQL_API SQLGetConnectOptionA( 697 | SQLHDBC hdbc, 698 | SQLUSMALLINT fOption, 699 | SQLPOINTER pvParam); 700 | 701 | SQLRETURN SQL_API SQLGetInfoA( 702 | SQLHDBC hdbc, 703 | SQLUSMALLINT fInfoType, 704 | _Out_writes_bytes_opt_(cbInfoValueMax) 705 | SQLPOINTER rgbInfoValue, 706 | SQLSMALLINT cbInfoValueMax, 707 | _Out_opt_ 708 | SQLSMALLINT* pcbInfoValue); 709 | 710 | SQLRETURN SQL_API SQLGetStmtOptionA( 711 | SQLHSTMT hstmt, 712 | SQLUSMALLINT fOption, 713 | SQLPOINTER pvParam); 714 | 715 | SQLRETURN SQL_API SQLSetConnectOptionA( 716 | SQLHDBC hdbc, 717 | SQLUSMALLINT fOption, 718 | SQLULEN vParam); 719 | 720 | SQLRETURN SQL_API SQLSetStmtOptionA( 721 | SQLHSTMT hstmt, 722 | SQLUSMALLINT fOption, 723 | SQLULEN vParam); 724 | 725 | SQLRETURN SQL_API SQLSpecialColumnsA( 726 | SQLHSTMT hstmt, 727 | SQLUSMALLINT fColType, 728 | _In_reads_opt_(cbCatalogName) 729 | SQLCHAR *szCatalogName, 730 | SQLSMALLINT cbCatalogName, 731 | _In_reads_opt_(cbSchemaName) 732 | SQLCHAR *szSchemaName, 733 | SQLSMALLINT cbSchemaName, 734 | _In_reads_opt_(cbTableName) 735 | SQLCHAR *szTableName, 736 | SQLSMALLINT cbTableName, 737 | SQLUSMALLINT fScope, 738 | SQLUSMALLINT fNullable); 739 | 740 | SQLRETURN SQL_API SQLStatisticsA( 741 | SQLHSTMT hstmt, 742 | _In_reads_opt_(cbCatalogName) 743 | SQLCHAR *szCatalogName, 744 | SQLSMALLINT cbCatalogName, 745 | _In_reads_opt_(cbSchemaName) 746 | SQLCHAR *szSchemaName, 747 | SQLSMALLINT cbSchemaName, 748 | _In_reads_opt_(cbTableName) 749 | SQLCHAR *szTableName, 750 | SQLSMALLINT cbTableName, 751 | SQLUSMALLINT fUnique, 752 | SQLUSMALLINT fAccuracy); 753 | 754 | SQLRETURN SQL_API SQLTablesA( 755 | SQLHSTMT hstmt, 756 | _In_reads_opt_(cbCatalogName) 757 | SQLCHAR *szCatalogName, 758 | SQLSMALLINT cbCatalogName, 759 | _In_reads_opt_(cbSchemaName) 760 | SQLCHAR *szSchemaName, 761 | SQLSMALLINT cbSchemaName, 762 | _In_reads_opt_(cbTableName) 763 | SQLCHAR *szTableName, 764 | SQLSMALLINT cbTableName, 765 | _In_reads_opt_(cbTableType) 766 | SQLCHAR *szTableType, 767 | SQLSMALLINT cbTableType); 768 | 769 | SQLRETURN SQL_API SQLDataSourcesA( 770 | SQLHENV henv, 771 | SQLUSMALLINT fDirection, 772 | _Out_writes_opt_(cbDSNMax) 773 | SQLCHAR *szDSN, 774 | SQLSMALLINT cbDSNMax, 775 | SQLSMALLINT *pcbDSN, 776 | _Out_writes_opt_(cbDescriptionMax) 777 | SQLCHAR *szDescription, 778 | SQLSMALLINT cbDescriptionMax, 779 | SQLSMALLINT *pcbDescription); 780 | 781 | SQLRETURN SQL_API SQLDriverConnectA( 782 | SQLHDBC hdbc, 783 | SQLHWND hwnd, 784 | _In_reads_(cbConnStrIn) 785 | SQLCHAR *szConnStrIn, 786 | SQLSMALLINT cbConnStrIn, 787 | _Out_writes_opt_(cbConnStrOutMax) 788 | SQLCHAR *szConnStrOut, 789 | SQLSMALLINT cbConnStrOutMax, 790 | _Out_opt_ 791 | SQLSMALLINT *pcbConnStrOut, 792 | SQLUSMALLINT fDriverCompletion); 793 | 794 | SQLRETURN SQL_API SQLBrowseConnectA( 795 | SQLHDBC hdbc, 796 | _In_reads_(cbConnStrIn) 797 | SQLCHAR *szConnStrIn, 798 | SQLSMALLINT cbConnStrIn, 799 | _Out_writes_opt_(cbConnStrOutMax) 800 | SQLCHAR *szConnStrOut, 801 | SQLSMALLINT cbConnStrOutMax, 802 | _Out_opt_ 803 | SQLSMALLINT *pcbConnStrOut); 804 | 805 | SQLRETURN SQL_API SQLColumnPrivilegesA( 806 | SQLHSTMT hstmt, 807 | _In_reads_opt_(cbCatalogName) 808 | SQLCHAR *szCatalogName, 809 | SQLSMALLINT cbCatalogName, 810 | _In_reads_opt_(cbSchemaName) 811 | SQLCHAR *szSchemaName, 812 | SQLSMALLINT cbSchemaName, 813 | _In_reads_opt_(cbTableName) 814 | SQLCHAR *szTableName, 815 | SQLSMALLINT cbTableName, 816 | _In_reads_opt_(cbColumnName) 817 | SQLCHAR *szColumnName, 818 | SQLSMALLINT cbColumnName); 819 | 820 | SQLRETURN SQL_API SQLDescribeParamA( 821 | SQLHSTMT hstmt, 822 | SQLUSMALLINT ipar, 823 | _Out_opt_ 824 | SQLSMALLINT *pfSqlType, 825 | _Out_opt_ 826 | SQLUINTEGER *pcbParamDef, 827 | _Out_opt_ 828 | SQLSMALLINT *pibScale, 829 | _Out_opt_ 830 | SQLSMALLINT *pfNullable); 831 | 832 | SQLRETURN SQL_API SQLForeignKeysA( 833 | SQLHSTMT hstmt, 834 | _In_reads_opt_(cbPkCatalogName) 835 | SQLCHAR *szPkCatalogName, 836 | SQLSMALLINT cbPkCatalogName, 837 | _In_reads_opt_(cbPkSchemaName) 838 | SQLCHAR *szPkSchemaName, 839 | SQLSMALLINT cbPkSchemaName, 840 | _In_reads_opt_(cbPkTableName) 841 | SQLCHAR *szPkTableName, 842 | SQLSMALLINT cbPkTableName, 843 | _In_reads_opt_(cbFkCatalogName) 844 | SQLCHAR *szFkCatalogName, 845 | SQLSMALLINT cbFkCatalogName, 846 | _In_reads_opt_(cbFkSchemaName) 847 | SQLCHAR *szFkSchemaName, 848 | SQLSMALLINT cbFkSchemaName, 849 | _In_reads_opt_(cbFkTableName) 850 | SQLCHAR *szFkTableName, 851 | SQLSMALLINT cbFkTableName); 852 | 853 | SQLRETURN SQL_API SQLNativeSqlA( 854 | SQLHDBC hdbc, 855 | _In_reads_(cbSqlStrIn) 856 | SQLCHAR *szSqlStrIn, 857 | SQLINTEGER cbSqlStrIn, 858 | _Out_writes_opt_(cbSqlStrMax) 859 | SQLCHAR *szSqlStr, 860 | SQLINTEGER cbSqlStrMax, 861 | SQLINTEGER *pcbSqlStr); 862 | 863 | SQLRETURN SQL_API SQLPrimaryKeysA( 864 | SQLHSTMT hstmt, 865 | _In_reads_opt_(cbCatalogName) 866 | SQLCHAR *szCatalogName, 867 | SQLSMALLINT cbCatalogName, 868 | _In_reads_opt_(cbSchemaName) 869 | SQLCHAR *szSchemaName, 870 | SQLSMALLINT cbSchemaName, 871 | _In_reads_opt_(cbTableName) 872 | SQLCHAR *szTableName, 873 | SQLSMALLINT cbTableName); 874 | 875 | SQLRETURN SQL_API SQLProcedureColumnsA( 876 | SQLHSTMT hstmt, 877 | _In_reads_opt_(cbCatalogName) 878 | SQLCHAR *szCatalogName, 879 | SQLSMALLINT cbCatalogName, 880 | _In_reads_opt_(cbSchemaName) 881 | SQLCHAR *szSchemaName, 882 | SQLSMALLINT cbSchemaName, 883 | _In_reads_opt_(cbProcName) 884 | SQLCHAR *szProcName, 885 | SQLSMALLINT cbProcName, 886 | _In_reads_opt_(cbColumnName) 887 | SQLCHAR *szColumnName, 888 | SQLSMALLINT cbColumnName); 889 | 890 | SQLRETURN SQL_API SQLProceduresA( 891 | SQLHSTMT hstmt, 892 | _In_reads_opt_(cbCatalogName) 893 | SQLCHAR *szCatalogName, 894 | SQLSMALLINT cbCatalogName, 895 | _In_reads_opt_(cbSchemaName) 896 | SQLCHAR *szSchemaName, 897 | SQLSMALLINT cbSchemaName, 898 | _In_reads_opt_(cbProcName) 899 | SQLCHAR *szProcName, 900 | SQLSMALLINT cbProcName); 901 | 902 | SQLRETURN SQL_API SQLTablePrivilegesA( 903 | SQLHSTMT hstmt, 904 | _In_reads_opt_(cbCatalogName) 905 | SQLCHAR *szCatalogName, 906 | SQLSMALLINT cbCatalogName, 907 | _In_reads_opt_(cbSchemaName) 908 | SQLCHAR *szSchemaName, 909 | SQLSMALLINT cbSchemaName, 910 | _In_reads_opt_(cbTableName) 911 | SQLCHAR *szTableName, 912 | SQLSMALLINT cbTableName); 913 | 914 | SQLRETURN SQL_API SQLDriversA( 915 | SQLHENV henv, 916 | SQLUSMALLINT fDirection, 917 | _Out_writes_opt_(cbDriverDescMax) 918 | SQLCHAR *szDriverDesc, 919 | SQLSMALLINT cbDriverDescMax, 920 | _Out_opt_ 921 | SQLSMALLINT *pcbDriverDesc, 922 | _Out_writes_opt_(cbDrvrAttrMax) 923 | SQLCHAR *szDriverAttributes, 924 | SQLSMALLINT cbDrvrAttrMax, 925 | _Out_opt_ 926 | SQLSMALLINT *pcbDrvrAttr); 927 | 928 | #if (ODBCVER >= 0x0400) 929 | SQLRETURN SQL_API SQLStructuredTypesA( 930 | SQLHSTMT hstmt, 931 | _In_reads_opt_(cbCatalogName) SQLCHAR *szCatalogName, 932 | SQLSMALLINT cbCatalogName, 933 | _In_reads_opt_(cbSchemaName) SQLCHAR *szSchemaName, 934 | SQLSMALLINT cbSchemaName, 935 | _In_reads_opt_(cbTypeName) SQLCHAR *szTypeName, 936 | SQLSMALLINT cbTypeName); 937 | 938 | SQLRETURN SQL_API SQLStructuredTypeColumnsA( 939 | SQLHSTMT hstmt, 940 | _In_reads_opt_(cbCatalogName) SQLCHAR *szCatalogName, 941 | SQLSMALLINT cbCatalogName, 942 | _In_reads_opt_(cbSchemaName) SQLCHAR *szSchemaName, 943 | SQLSMALLINT cbSchemaName, 944 | _In_reads_opt_(cbTypeName) SQLCHAR *szTypeName, 945 | SQLSMALLINT cbTypeName, 946 | _In_reads_opt_(cbColumnName) SQLCHAR *szColumnName, 947 | SQLSMALLINT cbColumnName); 948 | #endif /* ODBCVER >= 0x0400 */ 949 | //--------------------------------------------- 950 | // Mapping macros for Unicode 951 | //--------------------------------------------- 952 | #ifndef SQL_NOUNICODEMAP // define this to disable the mapping 953 | #ifdef UNICODE 954 | 955 | #define SQLColAttribute SQLColAttributeW 956 | #define SQLColAttributes SQLColAttributesW 957 | #define SQLConnect SQLConnectW 958 | #define SQLDescribeCol SQLDescribeColW 959 | #define SQLError SQLErrorW 960 | #define SQLExecDirect SQLExecDirectW 961 | #define SQLGetConnectAttr SQLGetConnectAttrW 962 | #define SQLGetCursorName SQLGetCursorNameW 963 | #define SQLGetDescField SQLGetDescFieldW 964 | #define SQLGetDescRec SQLGetDescRecW 965 | #define SQLGetDiagField SQLGetDiagFieldW 966 | #define SQLGetDiagRec SQLGetDiagRecW 967 | #define SQLPrepare SQLPrepareW 968 | #define SQLSetConnectAttr SQLSetConnectAttrW 969 | #define SQLSetCursorName SQLSetCursorNameW 970 | #define SQLSetDescField SQLSetDescFieldW 971 | #define SQLSetStmtAttr SQLSetStmtAttrW 972 | #define SQLGetStmtAttr SQLGetStmtAttrW 973 | #define SQLColumns SQLColumnsW 974 | #define SQLGetConnectOption SQLGetConnectOptionW 975 | #define SQLGetInfo SQLGetInfoW 976 | #define SQLGetTypeInfo SQLGetTypeInfoW 977 | #define SQLSetConnectOption SQLSetConnectOptionW 978 | #define SQLSpecialColumns SQLSpecialColumnsW 979 | #define SQLStatistics SQLStatisticsW 980 | #define SQLStructuredTypes SQLStructuredTypesW 981 | #define SQLStructuredTypeColumns SQLStructuredTypeColumnsW 982 | #define SQLTables SQLTablesW 983 | #define SQLDataSources SQLDataSourcesW 984 | #define SQLDriverConnect SQLDriverConnectW 985 | #define SQLBrowseConnect SQLBrowseConnectW 986 | #define SQLColumnPrivileges SQLColumnPrivilegesW 987 | #define SQLForeignKeys SQLForeignKeysW 988 | #define SQLNativeSql SQLNativeSqlW 989 | #define SQLPrimaryKeys SQLPrimaryKeysW 990 | #define SQLProcedureColumns SQLProcedureColumnsW 991 | #define SQLProcedures SQLProceduresW 992 | #define SQLTablePrivileges SQLTablePrivilegesW 993 | #define SQLDrivers SQLDriversW 994 | 995 | #endif /* UNICODE */ 996 | #endif /* SQL_NOUNICODEMAP */ 997 | 998 | #endif /* RC_INVOKED */ 999 | 1000 | 1001 | #ifdef __cplusplus 1002 | } /* End of extern "C" { */ 1003 | #endif /* __cplusplus */ 1004 | 1005 | 1006 | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ 1007 | #pragma endregion 1008 | 1009 | #endif /* #ifndef __SQLUCODE */ 1010 | -------------------------------------------------------------------------------- /Windows/inc/sql.h: -------------------------------------------------------------------------------- 1 | /******************************************************** 2 | * * 3 | * Copyright (C) Microsoft. All rights reserved. * 4 | * * 5 | ********************************************************/ 6 | 7 | //----------------------------------------------------------------------------- 8 | // File: sql.h 9 | // 10 | // Contents: This is the the main include for ODBC Core functions. 11 | // 12 | // Comments: preconditions: #include "windows.h" 13 | // 14 | //----------------------------------------------------------------------------- 15 | 16 | #if defined(_MSC_VER) && (_MSC_VER > 1000) 17 | #pragma once 18 | #endif 19 | 20 | #ifndef __SQL 21 | #define __SQL 22 | 23 | #include 24 | 25 | #pragma region Desktop Family 26 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 27 | 28 | /* 29 | * ODBCVER Default to ODBC version number (0x0380). To exclude 30 | * definitions introduced in version 3.8 (or above) 31 | * #define ODBCVER 0x0351 before #including 32 | */ 33 | #ifndef ODBCVER 34 | #define ODBCVER 0x0380 35 | #endif 36 | 37 | #ifndef __SQLTYPES 38 | #include "sqltypes.h" 39 | #endif 40 | 41 | #ifdef __cplusplus 42 | extern "C" { /* Assume C declarations for C++ */ 43 | #endif /* __cplusplus */ 44 | 45 | /* special length/indicator values */ 46 | #define SQL_NULL_DATA (-1) 47 | #define SQL_DATA_AT_EXEC (-2) 48 | 49 | /* return values from functions */ 50 | #define SQL_SUCCESS 0 51 | #define SQL_SUCCESS_WITH_INFO 1 52 | #if (ODBCVER >= 0x0300) 53 | #define SQL_NO_DATA 100 54 | #endif 55 | 56 | #if (ODBCVER >= 0x0380) 57 | #define SQL_PARAM_DATA_AVAILABLE 101 58 | #endif 59 | 60 | #define SQL_ERROR (-1) 61 | #define SQL_INVALID_HANDLE (-2) 62 | 63 | #define SQL_STILL_EXECUTING 2 64 | #define SQL_NEED_DATA 99 65 | 66 | /* test for SQL_SUCCESS or SQL_SUCCESS_WITH_INFO */ 67 | #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) 68 | 69 | /* flags for null-terminated string */ 70 | #define SQL_NTS (-3) 71 | #define SQL_NTSL (-3L) 72 | 73 | /* maximum message length */ 74 | #define SQL_MAX_MESSAGE_LENGTH 512 75 | 76 | /* date/time length constants */ 77 | #if (ODBCVER >= 0x0300) 78 | #define SQL_DATE_LEN 10 79 | #define SQL_TIME_LEN 8 /* add P+1 if precision is nonzero */ 80 | #define SQL_TIMESTAMP_LEN 19 /* add P+1 if precision is nonzero */ 81 | #endif 82 | 83 | /* handle type identifiers */ 84 | #if (ODBCVER >= 0x0300) 85 | #define SQL_HANDLE_ENV 1 86 | #define SQL_HANDLE_DBC 2 87 | #define SQL_HANDLE_STMT 3 88 | #define SQL_HANDLE_DESC 4 89 | #endif 90 | 91 | /* environment attribute */ 92 | #if (ODBCVER >= 0x0300) 93 | #define SQL_ATTR_OUTPUT_NTS 10001 94 | #endif 95 | 96 | /* connection attributes */ 97 | #if (ODBCVER >= 0x0300) 98 | #define SQL_ATTR_AUTO_IPD 10001 99 | #define SQL_ATTR_METADATA_ID 10014 100 | #endif /* ODBCVER >= 0x0300 */ 101 | 102 | /* statement attributes */ 103 | #if (ODBCVER >= 0x0300) 104 | #define SQL_ATTR_APP_ROW_DESC 10010 105 | #define SQL_ATTR_APP_PARAM_DESC 10011 106 | #define SQL_ATTR_IMP_ROW_DESC 10012 107 | #define SQL_ATTR_IMP_PARAM_DESC 10013 108 | #define SQL_ATTR_CURSOR_SCROLLABLE (-1) 109 | #define SQL_ATTR_CURSOR_SENSITIVITY (-2) 110 | #endif 111 | 112 | /* SQL_ATTR_CURSOR_SCROLLABLE values */ 113 | #if (ODBCVER >= 0x0300) 114 | #define SQL_NONSCROLLABLE 0 115 | #define SQL_SCROLLABLE 1 116 | #endif /* ODBCVER >= 0x0300 */ 117 | 118 | /* identifiers of fields in the SQL descriptor */ 119 | #if (ODBCVER >= 0x0300) 120 | #define SQL_DESC_COUNT 1001 121 | #define SQL_DESC_TYPE 1002 122 | #define SQL_DESC_LENGTH 1003 123 | #define SQL_DESC_OCTET_LENGTH_PTR 1004 124 | #define SQL_DESC_PRECISION 1005 125 | #define SQL_DESC_SCALE 1006 126 | #define SQL_DESC_DATETIME_INTERVAL_CODE 1007 127 | #define SQL_DESC_NULLABLE 1008 128 | #define SQL_DESC_INDICATOR_PTR 1009 129 | #define SQL_DESC_DATA_PTR 1010 130 | #define SQL_DESC_NAME 1011 131 | #define SQL_DESC_UNNAMED 1012 132 | #define SQL_DESC_OCTET_LENGTH 1013 133 | #define SQL_DESC_ALLOC_TYPE 1099 134 | #endif 135 | 136 | #if (ODBCVER >= 0x0400) 137 | #define SQL_DESC_CHARACTER_SET_CATALOG 1018 138 | #define SQL_DESC_CHARACTER_SET_SCHEMA 1019 139 | #define SQL_DESC_CHARACTER_SET_NAME 1020 140 | #define SQL_DESC_COLLATION_CATALOG 1015 141 | #define SQL_DESC_COLLATION_SCHEMA 1016 142 | #define SQL_DESC_COLLATION_NAME 1017 143 | #define SQL_DESC_USER_DEFINED_TYPE_CATALOG 1026 144 | #define SQL_DESC_USER_DEFINED_TYPE_SCHEMA 1027 145 | #define SQL_DESC_USER_DEFINED_TYPE_NAME 1028 146 | #endif /* ODBCVER >= 0x0400 */ 147 | 148 | /* identifiers of fields in the diagnostics area */ 149 | #if (ODBCVER >= 0x0300) 150 | #define SQL_DIAG_RETURNCODE 1 151 | #define SQL_DIAG_NUMBER 2 152 | #define SQL_DIAG_ROW_COUNT 3 153 | #define SQL_DIAG_SQLSTATE 4 154 | #define SQL_DIAG_NATIVE 5 155 | #define SQL_DIAG_MESSAGE_TEXT 6 156 | #define SQL_DIAG_DYNAMIC_FUNCTION 7 157 | #define SQL_DIAG_CLASS_ORIGIN 8 158 | #define SQL_DIAG_SUBCLASS_ORIGIN 9 159 | #define SQL_DIAG_CONNECTION_NAME 10 160 | #define SQL_DIAG_SERVER_NAME 11 161 | #define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12 162 | #endif 163 | 164 | /* dynamic function codes */ 165 | #if (ODBCVER >= 0x0300) 166 | #define SQL_DIAG_ALTER_DOMAIN 3 167 | #define SQL_DIAG_ALTER_TABLE 4 168 | #define SQL_DIAG_CALL 7 169 | #define SQL_DIAG_CREATE_ASSERTION 6 170 | #define SQL_DIAG_CREATE_CHARACTER_SET 8 171 | #define SQL_DIAG_CREATE_COLLATION 10 172 | #define SQL_DIAG_CREATE_DOMAIN 23 173 | #define SQL_DIAG_CREATE_INDEX (-1) 174 | #define SQL_DIAG_CREATE_SCHEMA 64 175 | #define SQL_DIAG_CREATE_TABLE 77 176 | #define SQL_DIAG_CREATE_TRANSLATION 79 177 | #define SQL_DIAG_CREATE_VIEW 84 178 | #define SQL_DIAG_DELETE_WHERE 19 179 | #define SQL_DIAG_DROP_ASSERTION 24 180 | #define SQL_DIAG_DROP_CHARACTER_SET 25 181 | #define SQL_DIAG_DROP_COLLATION 26 182 | #define SQL_DIAG_DROP_DOMAIN 27 183 | #define SQL_DIAG_DROP_INDEX (-2) 184 | #define SQL_DIAG_DROP_SCHEMA 31 185 | #define SQL_DIAG_DROP_TABLE 32 186 | #define SQL_DIAG_DROP_TRANSLATION 33 187 | #define SQL_DIAG_DROP_VIEW 36 188 | #define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38 189 | #define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81 190 | #define SQL_DIAG_GRANT 48 191 | #define SQL_DIAG_INSERT 50 192 | #define SQL_DIAG_REVOKE 59 193 | #define SQL_DIAG_SELECT_CURSOR 85 194 | #define SQL_DIAG_UNKNOWN_STATEMENT 0 195 | #define SQL_DIAG_UPDATE_WHERE 82 196 | #endif /* ODBCVER >= 0x0300 */ 197 | 198 | /* SQL data type codes */ 199 | #define SQL_UNKNOWN_TYPE 0 200 | #define SQL_CHAR 1 201 | #define SQL_NUMERIC 2 202 | #define SQL_DECIMAL 3 203 | #define SQL_INTEGER 4 204 | #define SQL_SMALLINT 5 205 | #define SQL_FLOAT 6 206 | #define SQL_REAL 7 207 | #define SQL_DOUBLE 8 208 | #if (ODBCVER >= 0x0300) 209 | #define SQL_DATETIME 9 210 | #endif 211 | #define SQL_VARCHAR 12 212 | 213 | #if (ODBCVER >= 0x0400) 214 | #define SQL_VARIANT_TYPE SQL_UNKNOWN_TYPE 215 | #define SQL_UDT 17 216 | #define SQL_ROW 19 217 | #define SQL_ARRAY 50 218 | #define SQL_MULTISET 55 219 | #endif /* ODBCVER >= 0x0400 */ 220 | 221 | /* One-parameter shortcuts for date/time data types */ 222 | #if (ODBCVER >= 0x0300) 223 | #define SQL_TYPE_DATE 91 224 | #define SQL_TYPE_TIME 92 225 | #define SQL_TYPE_TIMESTAMP 93 226 | #endif 227 | #if (ODBCVER >= 0x0400) 228 | #define SQL_TYPE_TIME_WITH_TIMEZONE 94 229 | #define SQL_TYPE_TIMESTAMP_WITH_TIMEZONE 95 230 | #endif /* ODBCVER >= 0x0400 */ 231 | 232 | /* Statement attribute values for cursor sensitivity */ 233 | #if (ODBCVER >= 0x0300) 234 | #define SQL_UNSPECIFIED 0 235 | #define SQL_INSENSITIVE 1 236 | #define SQL_SENSITIVE 2 237 | #endif 238 | 239 | /* GetTypeInfo() request for all data types */ 240 | #define SQL_ALL_TYPES 0 241 | 242 | /* Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() */ 243 | #if (ODBCVER >= 0x0300) 244 | #define SQL_DEFAULT 99 245 | #endif 246 | 247 | /* SQLSQLLEN GetData() code indicating that the application row descriptor 248 | * specifies the data type 249 | */ 250 | #if (ODBCVER >= 0x0300) 251 | #define SQL_ARD_TYPE (-99) 252 | #endif 253 | 254 | #if (ODBCVER >= 0x0380) 255 | #define SQL_APD_TYPE (-100) 256 | #endif 257 | 258 | /* SQL date/time type subcodes */ 259 | #if (ODBCVER >= 0x0300) 260 | #define SQL_CODE_DATE 1 261 | #define SQL_CODE_TIME 2 262 | #define SQL_CODE_TIMESTAMP 3 263 | #endif 264 | 265 | #if (ODBCVER >= 0x0400) 266 | #define SQL_CODE_TIME_WITH_TIMEZONE 4 267 | #define SQL_CODE_TIMESTAMP_WITH_TIMEZONE 5 268 | #endif /* ODBCVER >= 0x0400 */ 269 | 270 | /* CLI option values */ 271 | #if (ODBCVER >= 0x0300) 272 | #define SQL_FALSE 0 273 | #define SQL_TRUE 1 274 | #endif 275 | 276 | /* values of NULLABLE field in descriptor */ 277 | #define SQL_NO_NULLS 0 278 | #define SQL_NULLABLE 1 279 | 280 | /* Value returned by SQLGetTypeInfo() to denote that it is 281 | * not known whether or not a data type supports null values. 282 | */ 283 | #define SQL_NULLABLE_UNKNOWN 2 284 | 285 | /* Values returned by SQLGetTypeInfo() to show WHERE clause 286 | * supported 287 | */ 288 | #if (ODBCVER >= 0x0300) 289 | #define SQL_PRED_NONE 0 290 | #define SQL_PRED_CHAR 1 291 | #define SQL_PRED_BASIC 2 292 | #endif 293 | 294 | /* values of UNNAMED field in descriptor */ 295 | #if (ODBCVER >= 0x0300) 296 | #define SQL_NAMED 0 297 | #define SQL_UNNAMED 1 298 | #endif 299 | 300 | /* values of ALLOC_TYPE field in descriptor */ 301 | #if (ODBCVER >= 0x0300) 302 | #define SQL_DESC_ALLOC_AUTO 1 303 | #define SQL_DESC_ALLOC_USER 2 304 | #endif 305 | 306 | /* FreeStmt() options */ 307 | #define SQL_CLOSE 0 308 | #define SQL_DROP 1 309 | #define SQL_UNBIND 2 310 | #define SQL_RESET_PARAMS 3 311 | 312 | /* Codes used for FetchOrientation in SQLFetchScroll(), 313 | and in SQLDataSources() 314 | */ 315 | #define SQL_FETCH_NEXT 1 316 | #define SQL_FETCH_FIRST 2 317 | 318 | /* Other codes used for FetchOrientation in SQLFetchScroll() */ 319 | #define SQL_FETCH_LAST 3 320 | #define SQL_FETCH_PRIOR 4 321 | #define SQL_FETCH_ABSOLUTE 5 322 | #define SQL_FETCH_RELATIVE 6 323 | 324 | /* SQLEndTran() options */ 325 | #define SQL_COMMIT 0 326 | #define SQL_ROLLBACK 1 327 | 328 | /* null handles returned by SQLAllocHandle() */ 329 | #define SQL_NULL_HENV 0 330 | #define SQL_NULL_HDBC 0 331 | #define SQL_NULL_HSTMT 0 332 | #if (ODBCVER >= 0x0300) 333 | #define SQL_NULL_HDESC 0 334 | #endif 335 | 336 | /* null handle used in place of parent handle when allocating HENV */ 337 | #if (ODBCVER >= 0x0300) 338 | #define SQL_NULL_HANDLE 0L 339 | #endif 340 | 341 | /* Values that may appear in the result set of SQLSpecialColumns() */ 342 | #define SQL_SCOPE_CURROW 0 343 | #define SQL_SCOPE_TRANSACTION 1 344 | #define SQL_SCOPE_SESSION 2 345 | 346 | #define SQL_PC_UNKNOWN 0 347 | #if (ODBCVER >= 0x0300) 348 | #define SQL_PC_NON_PSEUDO 1 349 | #endif 350 | #define SQL_PC_PSEUDO 2 351 | 352 | /* Reserved value for the IdentifierType argument of SQLSpecialColumns() */ 353 | #if (ODBCVER >= 0x0300) 354 | #define SQL_ROW_IDENTIFIER 1 355 | #endif 356 | 357 | /* Reserved values for UNIQUE argument of SQLStatistics() */ 358 | #define SQL_INDEX_UNIQUE 0 359 | #define SQL_INDEX_ALL 1 360 | 361 | /* Values that may appear in the result set of SQLStatistics() */ 362 | #define SQL_INDEX_CLUSTERED 1 363 | #define SQL_INDEX_HASHED 2 364 | #define SQL_INDEX_OTHER 3 365 | 366 | /* SQLGetFunctions() values to identify ODBC APIs */ 367 | #define SQL_API_SQLALLOCCONNECT 1 368 | #define SQL_API_SQLALLOCENV 2 369 | #if (ODBCVER >= 0x0300) 370 | #define SQL_API_SQLALLOCHANDLE 1001 371 | #endif 372 | #define SQL_API_SQLALLOCSTMT 3 373 | #define SQL_API_SQLBINDCOL 4 374 | #if (ODBCVER >= 0x0300) 375 | #define SQL_API_SQLBINDPARAM 1002 376 | #endif 377 | #define SQL_API_SQLCANCEL 5 378 | #if (ODBCVER >= 0x0300) 379 | #define SQL_API_SQLCLOSECURSOR 1003 380 | #define SQL_API_SQLCOLATTRIBUTE 6 381 | #endif 382 | #define SQL_API_SQLCOLUMNS 40 383 | #define SQL_API_SQLCONNECT 7 384 | #if (ODBCVER >= 0x0300) 385 | #define SQL_API_SQLCOPYDESC 1004 386 | #endif 387 | #define SQL_API_SQLDATASOURCES 57 388 | #define SQL_API_SQLDESCRIBECOL 8 389 | #define SQL_API_SQLDISCONNECT 9 390 | #if (ODBCVER >= 0x0300) 391 | #define SQL_API_SQLENDTRAN 1005 392 | #endif 393 | #define SQL_API_SQLERROR 10 394 | #define SQL_API_SQLEXECDIRECT 11 395 | #define SQL_API_SQLEXECUTE 12 396 | #define SQL_API_SQLFETCH 13 397 | #if (ODBCVER >= 0x0300) 398 | #define SQL_API_SQLFETCHSCROLL 1021 399 | #endif 400 | #define SQL_API_SQLFREECONNECT 14 401 | #define SQL_API_SQLFREEENV 15 402 | #if (ODBCVER >= 0x0300) 403 | #define SQL_API_SQLFREEHANDLE 1006 404 | #endif 405 | #define SQL_API_SQLFREESTMT 16 406 | #if (ODBCVER >= 0x0300) 407 | #define SQL_API_SQLGETCONNECTATTR 1007 408 | #endif 409 | #define SQL_API_SQLGETCONNECTOPTION 42 410 | #define SQL_API_SQLGETCURSORNAME 17 411 | #define SQL_API_SQLGETDATA 43 412 | #if (ODBCVER >= 0x0300) 413 | #define SQL_API_SQLGETDESCFIELD 1008 414 | #define SQL_API_SQLGETDESCREC 1009 415 | #define SQL_API_SQLGETDIAGFIELD 1010 416 | #define SQL_API_SQLGETDIAGREC 1011 417 | #define SQL_API_SQLGETENVATTR 1012 418 | #endif 419 | #define SQL_API_SQLGETFUNCTIONS 44 420 | #define SQL_API_SQLGETINFO 45 421 | #if (ODBCVER >= 0x0300) 422 | #define SQL_API_SQLGETSTMTATTR 1014 423 | #endif 424 | #define SQL_API_SQLGETSTMTOPTION 46 425 | #define SQL_API_SQLGETTYPEINFO 47 426 | #define SQL_API_SQLNUMRESULTCOLS 18 427 | #define SQL_API_SQLPARAMDATA 48 428 | #define SQL_API_SQLPREPARE 19 429 | #define SQL_API_SQLPUTDATA 49 430 | #define SQL_API_SQLROWCOUNT 20 431 | #if (ODBCVER >= 0x0300) 432 | #define SQL_API_SQLSETCONNECTATTR 1016 433 | #endif 434 | #define SQL_API_SQLSETCONNECTOPTION 50 435 | #define SQL_API_SQLSETCURSORNAME 21 436 | #if (ODBCVER >= 0x0300) 437 | #define SQL_API_SQLSETDESCFIELD 1017 438 | #define SQL_API_SQLSETDESCREC 1018 439 | #define SQL_API_SQLSETENVATTR 1019 440 | #endif 441 | #define SQL_API_SQLSETPARAM 22 442 | #if (ODBCVER >= 0x0300) 443 | #define SQL_API_SQLSETSTMTATTR 1020 444 | #endif 445 | #define SQL_API_SQLSETSTMTOPTION 51 446 | #define SQL_API_SQLSPECIALCOLUMNS 52 447 | #define SQL_API_SQLSTATISTICS 53 448 | #define SQL_API_SQLTABLES 54 449 | #define SQL_API_SQLTRANSACT 23 450 | #if (ODBCVER >= 0x0380) 451 | #define SQL_API_SQLCANCELHANDLE 1550 452 | #define SQL_API_SQLCOMPLETEASYNC 1551 453 | 454 | #endif 455 | 456 | /* Information requested by SQLGetInfo() */ 457 | #if (ODBCVER >= 0x0300) 458 | #define SQL_MAX_DRIVER_CONNECTIONS 0 459 | #define SQL_MAXIMUM_DRIVER_CONNECTIONS SQL_MAX_DRIVER_CONNECTIONS 460 | #define SQL_MAX_CONCURRENT_ACTIVITIES 1 461 | #define SQL_MAXIMUM_CONCURRENT_ACTIVITIES SQL_MAX_CONCURRENT_ACTIVITIES 462 | #endif 463 | #define SQL_DATA_SOURCE_NAME 2 464 | #define SQL_FETCH_DIRECTION 8 465 | #define SQL_SERVER_NAME 13 466 | #define SQL_SEARCH_PATTERN_ESCAPE 14 467 | #define SQL_DBMS_NAME 17 468 | #define SQL_DBMS_VER 18 469 | #define SQL_ACCESSIBLE_TABLES 19 470 | #define SQL_ACCESSIBLE_PROCEDURES 20 471 | #define SQL_CURSOR_COMMIT_BEHAVIOR 23 472 | #define SQL_DATA_SOURCE_READ_ONLY 25 473 | #define SQL_DEFAULT_TXN_ISOLATION 26 474 | #define SQL_IDENTIFIER_CASE 28 475 | #define SQL_IDENTIFIER_QUOTE_CHAR 29 476 | #define SQL_MAX_COLUMN_NAME_LEN 30 477 | #define SQL_MAXIMUM_COLUMN_NAME_LENGTH SQL_MAX_COLUMN_NAME_LEN 478 | #define SQL_MAX_CURSOR_NAME_LEN 31 479 | #define SQL_MAXIMUM_CURSOR_NAME_LENGTH SQL_MAX_CURSOR_NAME_LEN 480 | #define SQL_MAX_SCHEMA_NAME_LEN 32 481 | #define SQL_MAXIMUM_SCHEMA_NAME_LENGTH SQL_MAX_SCHEMA_NAME_LEN 482 | #define SQL_MAX_CATALOG_NAME_LEN 34 483 | #define SQL_MAXIMUM_CATALOG_NAME_LENGTH SQL_MAX_CATALOG_NAME_LEN 484 | #define SQL_MAX_TABLE_NAME_LEN 35 485 | #define SQL_SCROLL_CONCURRENCY 43 486 | #define SQL_TXN_CAPABLE 46 487 | #define SQL_TRANSACTION_CAPABLE SQL_TXN_CAPABLE 488 | #define SQL_USER_NAME 47 489 | #define SQL_TXN_ISOLATION_OPTION 72 490 | #define SQL_TRANSACTION_ISOLATION_OPTION SQL_TXN_ISOLATION_OPTION 491 | #define SQL_INTEGRITY 73 492 | #define SQL_GETDATA_EXTENSIONS 81 493 | #define SQL_NULL_COLLATION 85 494 | #define SQL_ALTER_TABLE 86 495 | #define SQL_ORDER_BY_COLUMNS_IN_SELECT 90 496 | #define SQL_SPECIAL_CHARACTERS 94 497 | #define SQL_MAX_COLUMNS_IN_GROUP_BY 97 498 | #define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY SQL_MAX_COLUMNS_IN_GROUP_BY 499 | #define SQL_MAX_COLUMNS_IN_INDEX 98 500 | #define SQL_MAXIMUM_COLUMNS_IN_INDEX SQL_MAX_COLUMNS_IN_INDEX 501 | #define SQL_MAX_COLUMNS_IN_ORDER_BY 99 502 | #define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY SQL_MAX_COLUMNS_IN_ORDER_BY 503 | #define SQL_MAX_COLUMNS_IN_SELECT 100 504 | #define SQL_MAXIMUM_COLUMNS_IN_SELECT SQL_MAX_COLUMNS_IN_SELECT 505 | #define SQL_MAX_COLUMNS_IN_TABLE 101 506 | #define SQL_MAX_INDEX_SIZE 102 507 | #define SQL_MAXIMUM_INDEX_SIZE SQL_MAX_INDEX_SIZE 508 | #define SQL_MAX_ROW_SIZE 104 509 | #define SQL_MAXIMUM_ROW_SIZE SQL_MAX_ROW_SIZE 510 | #define SQL_MAX_STATEMENT_LEN 105 511 | #define SQL_MAXIMUM_STATEMENT_LENGTH SQL_MAX_STATEMENT_LEN 512 | #define SQL_MAX_TABLES_IN_SELECT 106 513 | #define SQL_MAXIMUM_TABLES_IN_SELECT SQL_MAX_TABLES_IN_SELECT 514 | #define SQL_MAX_USER_NAME_LEN 107 515 | #define SQL_MAXIMUM_USER_NAME_LENGTH SQL_MAX_USER_NAME_LEN 516 | #if (ODBCVER >= 0x0300) 517 | #define SQL_OJ_CAPABILITIES 115 518 | #define SQL_OUTER_JOIN_CAPABILITIES SQL_OJ_CAPABILITIES 519 | #endif /* ODBCVER >= 0x0300 */ 520 | 521 | #if (ODBCVER >= 0x0300) 522 | #define SQL_XOPEN_CLI_YEAR 10000 523 | #define SQL_CURSOR_SENSITIVITY 10001 524 | #define SQL_DESCRIBE_PARAMETER 10002 525 | #define SQL_CATALOG_NAME 10003 526 | #define SQL_COLLATION_SEQ 10004 527 | #define SQL_MAX_IDENTIFIER_LEN 10005 528 | #define SQL_MAXIMUM_IDENTIFIER_LENGTH SQL_MAX_IDENTIFIER_LEN 529 | #endif /* ODBCVER >= 0x0300 */ 530 | 531 | /* SQL_ALTER_TABLE bitmasks */ 532 | #if (ODBCVER >= 0x0200) 533 | #define SQL_AT_ADD_COLUMN 0x00000001L 534 | #define SQL_AT_DROP_COLUMN 0x00000002L 535 | #endif /* ODBCVER >= 0x0200 */ 536 | 537 | #if (ODBCVER >= 0x0300) 538 | #define SQL_AT_ADD_CONSTRAINT 0x00000008L 539 | 540 | /* The following bitmasks are ODBC extensions and defined in sqlext.h 541 | *#define SQL_AT_COLUMN_SINGLE 0x00000020L 542 | *#define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L 543 | *#define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L 544 | *#define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L 545 | *#define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L 546 | *#define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L 547 | *#define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L 548 | *#define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L 549 | *#define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L 550 | *#define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L 551 | *#define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L 552 | *#define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L 553 | *#define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L 554 | *#define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L 555 | *#define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L 556 | */ 557 | #endif /* ODBCVER >= 0x0300 */ 558 | 559 | 560 | /* SQL_ASYNC_MODE values */ 561 | #if (ODBCVER >= 0x0300) 562 | #define SQL_AM_NONE 0 563 | #define SQL_AM_CONNECTION 1 564 | #define SQL_AM_STATEMENT 2 565 | #endif 566 | 567 | /* SQL_CURSOR_COMMIT_BEHAVIOR values */ 568 | #define SQL_CB_DELETE 0 569 | #define SQL_CB_CLOSE 1 570 | #define SQL_CB_PRESERVE 2 571 | 572 | /* SQL_FETCH_DIRECTION bitmasks */ 573 | #define SQL_FD_FETCH_NEXT 0x00000001L 574 | #define SQL_FD_FETCH_FIRST 0x00000002L 575 | #define SQL_FD_FETCH_LAST 0x00000004L 576 | #define SQL_FD_FETCH_PRIOR 0x00000008L 577 | #define SQL_FD_FETCH_ABSOLUTE 0x00000010L 578 | #define SQL_FD_FETCH_RELATIVE 0x00000020L 579 | 580 | /* SQL_GETDATA_EXTENSIONS bitmasks */ 581 | #define SQL_GD_ANY_COLUMN 0x00000001L 582 | #define SQL_GD_ANY_ORDER 0x00000002L 583 | 584 | /* SQL_IDENTIFIER_CASE values */ 585 | #define SQL_IC_UPPER 1 586 | #define SQL_IC_LOWER 2 587 | #define SQL_IC_SENSITIVE 3 588 | #define SQL_IC_MIXED 4 589 | 590 | /* SQL_OJ_CAPABILITIES bitmasks */ 591 | /* NB: this means 'outer join', not what you may be thinking */ 592 | 593 | 594 | #if (ODBCVER >= 0x0201) 595 | #define SQL_OJ_LEFT 0x00000001L 596 | #define SQL_OJ_RIGHT 0x00000002L 597 | #define SQL_OJ_FULL 0x00000004L 598 | #define SQL_OJ_NESTED 0x00000008L 599 | #define SQL_OJ_NOT_ORDERED 0x00000010L 600 | #define SQL_OJ_INNER 0x00000020L 601 | #define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L 602 | #endif 603 | 604 | /* SQL_SCROLL_CONCURRENCY bitmasks */ 605 | #define SQL_SCCO_READ_ONLY 0x00000001L 606 | #define SQL_SCCO_LOCK 0x00000002L 607 | #define SQL_SCCO_OPT_ROWVER 0x00000004L 608 | #define SQL_SCCO_OPT_VALUES 0x00000008L 609 | 610 | /* SQL_TXN_CAPABLE values */ 611 | #define SQL_TC_NONE 0 612 | #define SQL_TC_DML 1 613 | #define SQL_TC_ALL 2 614 | #define SQL_TC_DDL_COMMIT 3 615 | #define SQL_TC_DDL_IGNORE 4 616 | 617 | /* SQL_TXN_ISOLATION_OPTION bitmasks */ 618 | #define SQL_TXN_READ_UNCOMMITTED 0x00000001L 619 | #define SQL_TRANSACTION_READ_UNCOMMITTED SQL_TXN_READ_UNCOMMITTED 620 | #define SQL_TXN_READ_COMMITTED 0x00000002L 621 | #define SQL_TRANSACTION_READ_COMMITTED SQL_TXN_READ_COMMITTED 622 | #define SQL_TXN_REPEATABLE_READ 0x00000004L 623 | #define SQL_TRANSACTION_REPEATABLE_READ SQL_TXN_REPEATABLE_READ 624 | #define SQL_TXN_SERIALIZABLE 0x00000008L 625 | #define SQL_TRANSACTION_SERIALIZABLE SQL_TXN_SERIALIZABLE 626 | 627 | /* SQL_NULL_COLLATION values */ 628 | #define SQL_NC_HIGH 0 629 | #define SQL_NC_LOW 1 630 | 631 | #ifndef RC_INVOKED 632 | 633 | SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle, 634 | _Out_ SQLHDBC *ConnectionHandle); 635 | 636 | SQLRETURN SQL_API SQLAllocEnv(_Out_ SQLHENV *EnvironmentHandle); 637 | 638 | #if (ODBCVER >= 0x0300) 639 | SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, 640 | SQLHANDLE InputHandle, _Out_ SQLHANDLE *OutputHandle); 641 | #endif 642 | 643 | SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle, 644 | _Out_ SQLHSTMT *StatementHandle); 645 | 646 | SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle, 647 | SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, 648 | _Inout_updates_opt_(_Inexpressible_(BufferLength)) SQLPOINTER TargetValue, 649 | SQLLEN BufferLength, _Inout_opt_ SQLLEN *StrLen_or_Ind); 650 | 651 | #if (ODBCVER >= 0x0300) 652 | __declspec(deprecated("ODBC API: SQLBindParam is deprecated. Please use SQLBindParameter instead.")) 653 | SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle, 654 | SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, 655 | SQLSMALLINT ParameterType, SQLULEN LengthPrecision, 656 | SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, 657 | SQLLEN *StrLen_or_Ind); 658 | #endif 659 | 660 | SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle); 661 | 662 | #if (ODBCVER >= 0x0380) 663 | SQLRETURN SQL_API SQLCancelHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle); 664 | #endif // ODBCVER >= 0x0380 665 | 666 | #if (ODBCVER >= 0x0300) 667 | SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle); 668 | 669 | #ifdef _WIN64 670 | SQLRETURN SQL_API SQLColAttribute (SQLHSTMT StatementHandle, 671 | SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, 672 | _Out_writes_bytes_opt_(BufferLength) SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, 673 | _Out_opt_ SQLSMALLINT *StringLength, _Out_opt_ SQLLEN *NumericAttribute); 674 | #else 675 | SQLRETURN SQL_API SQLColAttribute (SQLHSTMT StatementHandle, 676 | SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, 677 | _Out_writes_bytes_opt_(BufferLength) SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, 678 | _Out_opt_ SQLSMALLINT *StringLength, _Out_opt_ SQLPOINTER NumericAttribute); 679 | #endif 680 | #endif 681 | 682 | 683 | SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle, 684 | _In_reads_opt_(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, 685 | _In_reads_opt_(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, 686 | _In_reads_opt_(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, 687 | _In_reads_opt_(NameLength4) SQLCHAR *ColumnName, SQLSMALLINT NameLength4); 688 | 689 | #if (ODBCVER >= 0x0380) 690 | SQLRETURN SQL_API SQLCompleteAsync(SQLSMALLINT HandleType, 691 | SQLHANDLE Handle, 692 | _Out_ RETCODE* AsyncRetCodePtr); 693 | #endif 694 | 695 | SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle, 696 | _In_reads_(NameLength1) SQLCHAR *ServerName, SQLSMALLINT NameLength1, 697 | _In_reads_(NameLength2) SQLCHAR *UserName, SQLSMALLINT NameLength2, 698 | _In_reads_(NameLength3) SQLCHAR *Authentication, SQLSMALLINT NameLength3); 699 | 700 | #if (ODBCVER >= 0x0300) 701 | SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, 702 | SQLHDESC TargetDescHandle); 703 | #endif 704 | 705 | SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle, 706 | SQLUSMALLINT Direction, _Out_writes_opt_(BufferLength1) SQLCHAR *ServerName, 707 | SQLSMALLINT BufferLength1, _Out_opt_ SQLSMALLINT *NameLength1Ptr, 708 | _Out_writes_opt_(BufferLength2) SQLCHAR *Description, SQLSMALLINT BufferLength2, 709 | _Out_opt_ SQLSMALLINT *NameLength2Ptr); 710 | 711 | SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, 712 | SQLUSMALLINT ColumnNumber, _Out_writes_opt_(BufferLength) SQLCHAR *ColumnName, 713 | SQLSMALLINT BufferLength, _Out_opt_ SQLSMALLINT *NameLength, 714 | _Out_opt_ SQLSMALLINT *DataType, _Out_opt_ SQLULEN *ColumnSize, 715 | _Out_opt_ SQLSMALLINT *DecimalDigits, _Out_opt_ SQLSMALLINT *Nullable); 716 | 717 | SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle); 718 | 719 | #if (ODBCVER >= 0x0300) 720 | SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, 721 | SQLSMALLINT CompletionType); 722 | #endif 723 | 724 | SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle, 725 | SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, 726 | _Out_writes_(6) SQLCHAR *Sqlstate, _Out_opt_ SQLINTEGER *NativeError, 727 | _Out_writes_opt_(BufferLength) SQLCHAR *MessageText, SQLSMALLINT BufferLength, 728 | _Out_opt_ SQLSMALLINT *TextLength); 729 | 730 | SQLRETURN SQL_API SQLExecDirect 731 | ( 732 | SQLHSTMT StatementHandle, 733 | _In_reads_opt_(TextLength) SQLCHAR* StatementText, 734 | SQLINTEGER TextLength 735 | ); 736 | 737 | SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle); 738 | 739 | SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle); 740 | 741 | #if (ODBCVER >= 0x0300) 742 | SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, 743 | SQLSMALLINT FetchOrientation, SQLLEN FetchOffset); 744 | #endif 745 | 746 | SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle); 747 | 748 | SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle); 749 | 750 | #if (ODBCVER >= 0x0300) 751 | SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); 752 | #endif 753 | 754 | SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, 755 | SQLUSMALLINT Option); 756 | 757 | #if (ODBCVER >= 0x0300) 758 | SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, 759 | SQLINTEGER Attribute, _Out_writes_opt_(_Inexpressible_(BufferLength)) SQLPOINTER Value, 760 | SQLINTEGER BufferLength, _Out_opt_ SQLINTEGER *StringLengthPtr); 761 | __declspec(deprecated("ODBC API: SQLGetConnectOption is deprecated. Please use SQLGetConnectAttr instead.")) 762 | #endif 763 | 764 | SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle, 765 | SQLUSMALLINT Option, SQLPOINTER Value); 766 | 767 | SQLRETURN SQL_API SQLGetCursorName 768 | ( 769 | SQLHSTMT StatementHandle, 770 | _Out_writes_opt_(BufferLength) SQLCHAR *CursorName, 771 | SQLSMALLINT BufferLength, 772 | _Out_opt_ 773 | SQLSMALLINT *NameLengthPtr 774 | ); 775 | 776 | SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle, 777 | SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, 778 | _Out_writes_opt_(_Inexpressible_(BufferLength)) SQLPOINTER TargetValue, SQLLEN BufferLength, 779 | _Out_opt_ SQLLEN *StrLen_or_IndPtr); 780 | 781 | #if (ODBCVER >= 0x0300) 782 | SQLRETURN SQL_API SQLGetDescField(SQLHDESC DescriptorHandle, 783 | SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, 784 | _Out_writes_opt_(_Inexpressible_(BufferLength)) SQLPOINTER Value, SQLINTEGER BufferLength, 785 | _Out_opt_ SQLINTEGER *StringLength); 786 | 787 | SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, 788 | SQLSMALLINT RecNumber, _Out_writes_opt_(BufferLength) SQLCHAR *Name, 789 | SQLSMALLINT BufferLength, _Out_opt_ SQLSMALLINT *StringLengthPtr, 790 | _Out_opt_ SQLSMALLINT *TypePtr, _Out_opt_ SQLSMALLINT *SubTypePtr, 791 | _Out_opt_ SQLLEN *LengthPtr, _Out_opt_ SQLSMALLINT *PrecisionPtr, 792 | _Out_opt_ SQLSMALLINT *ScalePtr, _Out_opt_ SQLSMALLINT *NullablePtr); 793 | 794 | SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, 795 | SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, 796 | _Out_writes_opt_(_Inexpressible_(BufferLength)) SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, 797 | _Out_opt_ SQLSMALLINT *StringLength); 798 | 799 | SQLRETURN SQL_API SQLGetDiagRec 800 | ( 801 | SQLSMALLINT HandleType, 802 | SQLHANDLE Handle, 803 | SQLSMALLINT RecNumber, 804 | _Out_writes_opt_(6) SQLCHAR *Sqlstate, 805 | SQLINTEGER *NativeError, 806 | _Out_writes_opt_(BufferLength) SQLCHAR* MessageText, 807 | SQLSMALLINT BufferLength, 808 | _Out_opt_ 809 | SQLSMALLINT *TextLength 810 | ); 811 | 812 | SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, 813 | SQLINTEGER Attribute, _Out_writes_(_Inexpressible_(BufferLength)) SQLPOINTER Value, 814 | SQLINTEGER BufferLength, _Out_opt_ SQLINTEGER *StringLength); 815 | #endif /* ODBCVER >= 0x0300 */ 816 | 817 | SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle, 818 | SQLUSMALLINT FunctionId, 819 | _Out_writes_opt_(_Inexpressible_("Buffer length pfExists points to depends on fFunction value.")) 820 | SQLUSMALLINT *Supported); 821 | 822 | _Success_(return == SQL_SUCCESS) 823 | SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, 824 | SQLUSMALLINT InfoType, _Out_writes_bytes_opt_(BufferLength) SQLPOINTER InfoValue, 825 | SQLSMALLINT BufferLength, _Out_opt_ SQLSMALLINT *StringLengthPtr); 826 | 827 | #if (ODBCVER >= 0x0300) 828 | SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, 829 | SQLINTEGER Attribute, _Out_writes_opt_(_Inexpressible_(BufferLength)) SQLPOINTER Value, 830 | SQLINTEGER BufferLength, _Out_opt_ SQLINTEGER *StringLength); 831 | __declspec(deprecated("ODBC API: SQLGetStmtOption is deprecated. Please use SQLGetStmtAttr instead.")) 832 | #endif /* ODBCVER >= 0x0300 */ 833 | 834 | SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle, 835 | SQLUSMALLINT Option, SQLPOINTER Value); 836 | 837 | SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, 838 | SQLSMALLINT DataType); 839 | 840 | SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, 841 | _Out_ SQLSMALLINT *ColumnCount); 842 | 843 | SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle, 844 | _Out_opt_ SQLPOINTER *Value); 845 | 846 | SQLRETURN SQL_API SQLPrepare 847 | ( 848 | SQLHSTMT StatementHandle, 849 | _In_reads_(TextLength) SQLCHAR* StatementText, 850 | SQLINTEGER TextLength 851 | ); 852 | 853 | SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle, 854 | _In_reads_(_Inexpressible_(StrLen_or_Ind)) SQLPOINTER Data, SQLLEN StrLen_or_Ind); 855 | 856 | SQLRETURN SQL_API SQLRowCount(_In_ SQLHSTMT StatementHandle, 857 | _Out_ SQLLEN* RowCount); 858 | 859 | #if (ODBCVER >= 0x0300) 860 | SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, 861 | SQLINTEGER Attribute, _In_reads_bytes_opt_(StringLength) SQLPOINTER Value, 862 | SQLINTEGER StringLength); 863 | __declspec(deprecated("ODBC API: SQLSetConnectOption is deprecated. Please use SQLSetConnectAttr instead.")) 864 | #endif /* ODBCVER >= 0x0300 */ 865 | 866 | SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle, 867 | SQLUSMALLINT Option, SQLULEN Value); 868 | 869 | SQLRETURN SQL_API SQLSetCursorName 870 | ( 871 | SQLHSTMT StatementHandle, 872 | _In_reads_(NameLength) SQLCHAR* CursorName, 873 | SQLSMALLINT NameLength 874 | ); 875 | 876 | #if (ODBCVER >= 0x0300) 877 | SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, 878 | SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, 879 | _In_reads_(_Inexpressible_(BufferLength)) SQLPOINTER Value, SQLINTEGER BufferLength); 880 | 881 | SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, 882 | SQLSMALLINT RecNumber, SQLSMALLINT Type, 883 | SQLSMALLINT SubType, SQLLEN Length, 884 | SQLSMALLINT Precision, SQLSMALLINT Scale, 885 | _Inout_updates_bytes_opt_(Length) SQLPOINTER Data, _Inout_opt_ SQLLEN *StringLength, 886 | _Inout_opt_ SQLLEN *Indicator); 887 | 888 | SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, 889 | SQLINTEGER Attribute, _In_reads_bytes_opt_(StringLength) SQLPOINTER Value, 890 | SQLINTEGER StringLength); 891 | #endif /* ODBCVER >= 0x0300 */ 892 | 893 | __declspec(deprecated("ODBC API: SQLSetParam is deprecated. Please use SQLBindParameter instead.")) 894 | SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle, 895 | SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, 896 | SQLSMALLINT ParameterType, SQLULEN LengthPrecision, 897 | SQLSMALLINT ParameterScale, _In_reads_(_Inexpressible_(*StrLen_or_Ind)) SQLPOINTER ParameterValue, 898 | _Inout_ SQLLEN *StrLen_or_Ind); 899 | 900 | #if (ODBCVER >= 0x0300) 901 | SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, 902 | SQLINTEGER Attribute, _In_reads_(_Inexpressible_(StringLength)) SQLPOINTER Value, 903 | SQLINTEGER StringLength); 904 | __declspec(deprecated("ODBC API: SQLSetStmtOption is deprecated. Please use SQLSetStmtAttr instead.")) 905 | #endif 906 | 907 | SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle, 908 | SQLUSMALLINT Option, SQLULEN Value); 909 | 910 | SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, 911 | SQLUSMALLINT IdentifierType, 912 | _In_reads_opt_(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, 913 | _In_reads_opt_(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, 914 | _In_reads_opt_(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, 915 | SQLUSMALLINT Scope, SQLUSMALLINT Nullable); 916 | 917 | SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle, 918 | _In_reads_opt_(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, 919 | _In_reads_opt_(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, 920 | _In_reads_opt_(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, 921 | SQLUSMALLINT Unique, SQLUSMALLINT Reserved); 922 | 923 | SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle, 924 | _In_reads_opt_(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, 925 | _In_reads_opt_(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, 926 | _In_reads_opt_(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, 927 | _In_reads_opt_(NameLength4) SQLCHAR *TableType, SQLSMALLINT NameLength4); 928 | 929 | SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle, 930 | SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); 931 | 932 | #endif /* RC_INVOKED */ 933 | 934 | #ifdef __cplusplus 935 | } /* End of extern "C" { */ 936 | #endif /* __cplusplus */ 937 | 938 | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ 939 | #pragma endregion 940 | 941 | #endif /* #ifndef __SQL */ 942 | -------------------------------------------------------------------------------- /Windows/inc/sqlext.h: -------------------------------------------------------------------------------- 1 | /******************************************************** 2 | * * 3 | * Copyright (C) Microsoft. All rights reserved. * 4 | * * 5 | ********************************************************/ 6 | 7 | //----------------------------------------------------------------------------- 8 | // File: sqlext.h 9 | // 10 | // Contents: This is the include for applications using the Microsoft SQL Extensions 11 | // 12 | // Comments: 13 | // 14 | //----------------------------------------------------------------------------- 15 | 16 | #if defined(_MSC_VER) && (_MSC_VER > 1000) 17 | #pragma once 18 | #endif 19 | 20 | #ifndef __SQLEXT 21 | #define __SQLEXT 22 | 23 | #include 24 | 25 | #pragma region Desktop Family 26 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 27 | 28 | #ifndef __SQL 29 | #include "sql.h" 30 | #endif 31 | 32 | #ifdef __cplusplus 33 | extern "C" { /* Assume C declarations for C++ */ 34 | #endif /* __cplusplus */ 35 | 36 | /* generally useful constants */ 37 | #define SQL_SPEC_MAJOR 4 /* Major version of specification */ 38 | #define SQL_SPEC_MINOR 00 /* Minor version of specification */ 39 | #define SQL_SPEC_STRING "04.00" /* String constant for version */ 40 | 41 | #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */ 42 | 43 | typedef SQLTCHAR SQLSTATE[SQL_SQLSTATE_SIZE+1]; 44 | 45 | #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */ 46 | 47 | #define SQL_MAX_OPTION_STRING_LENGTH 256 48 | 49 | /* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */ 50 | #if (ODBCVER < 0x0300) 51 | #define SQL_NO_DATA_FOUND 100 52 | #else 53 | #define SQL_NO_DATA_FOUND SQL_NO_DATA 54 | #endif 55 | 56 | /* extended function return values */ 57 | #if (ODBCVER >= 0x0400) 58 | #define SQL_DATA_AVAILABLE 102 59 | #define SQL_METADATA_CHANGED 103 60 | #define SQL_MORE_DATA 104 61 | #endif /*ODBC >= 0x0400*/ 62 | 63 | /* an end handle type */ 64 | #if (ODBCVER >= 0x0300) 65 | #define SQL_HANDLE_SENV 5 66 | #endif /* ODBCVER >= 0x0300 */ 67 | 68 | /* env attribute */ 69 | #if (ODBCVER >= 0x0300) 70 | #define SQL_ATTR_ODBC_VERSION 200 71 | #define SQL_ATTR_CONNECTION_POOLING 201 72 | #define SQL_ATTR_CP_MATCH 202 73 | // For private driver manager 74 | #define SQL_ATTR_APPLICATION_KEY 203 75 | #endif /* ODBCVER >= 0x0300 */ 76 | 77 | #if (ODBCVER >= 0x0300) 78 | /* values for SQL_ATTR_CONNECTION_POOLING */ 79 | #define SQL_CP_OFF 0UL 80 | #define SQL_CP_ONE_PER_DRIVER 1UL 81 | #define SQL_CP_ONE_PER_HENV 2UL 82 | #define SQL_CP_DRIVER_AWARE 3UL 83 | #define SQL_CP_DEFAULT SQL_CP_OFF 84 | 85 | /* values for SQL_ATTR_CP_MATCH */ 86 | #define SQL_CP_STRICT_MATCH 0UL 87 | #define SQL_CP_RELAXED_MATCH 1UL 88 | #define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH 89 | 90 | /* values for SQL_ATTR_ODBC_VERSION */ 91 | #define SQL_OV_ODBC2 2UL 92 | #define SQL_OV_ODBC3 3UL 93 | #endif /* ODBCVER >= 0x0300 */ 94 | 95 | #if (ODBCVER >= 0x0380) 96 | // new values for SQL_ATTR_ODBC_VERSION 97 | // From ODBC 3.8 onwards, we should use * 100 + 98 | #define SQL_OV_ODBC3_80 380UL 99 | #endif /* ODBCVER >= 0x0380 */ 100 | 101 | #if (ODBCVER >= 0x0400) 102 | #define SQL_OV_ODBC4 400UL 103 | #endif /* ODBCVER >= 0x0400 */ 104 | 105 | /* connection attributes */ 106 | #define SQL_ACCESS_MODE 101 107 | #define SQL_AUTOCOMMIT 102 108 | #define SQL_LOGIN_TIMEOUT 103 109 | #define SQL_OPT_TRACE 104 110 | #define SQL_OPT_TRACEFILE 105 111 | #define SQL_TRANSLATE_DLL 106 112 | #define SQL_TRANSLATE_OPTION 107 113 | #define SQL_TXN_ISOLATION 108 114 | #define SQL_CURRENT_QUALIFIER 109 115 | #define SQL_ODBC_CURSORS 110 116 | #define SQL_QUIET_MODE 111 117 | #define SQL_PACKET_SIZE 112 118 | 119 | /* connection attributes with new names */ 120 | #if (ODBCVER >= 0x0300) 121 | #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE 122 | #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT 123 | #define SQL_ATTR_CONNECTION_TIMEOUT 113 124 | #define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER 125 | #define SQL_ATTR_DISCONNECT_BEHAVIOR 114 126 | #define SQL_ATTR_ENLIST_IN_DTC 1207 127 | #define SQL_ATTR_ENLIST_IN_XA 1208 128 | #define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT 129 | #define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS 130 | #define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE 131 | #define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE 132 | #define SQL_ATTR_TRACE SQL_OPT_TRACE 133 | #define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE 134 | #define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL 135 | #define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION 136 | #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION 137 | #endif /* ODBCVER >= 0x0300 */ 138 | 139 | #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */ 140 | 141 | #if (ODBCVER >= 0x0351) 142 | /* ODBC Driver Manager sets this connection attribute to a unicode driver 143 | (which supports SQLConnectW) when the application is an ANSI application 144 | (which calls SQLConnect, SQLDriverConnect, or SQLBrowseConnect). 145 | This is SetConnectAttr only and application does not set this attribute 146 | This attribute was introduced because some unicode driver's some APIs may 147 | need to behave differently on ANSI or Unicode applications. A unicode 148 | driver, which has same behavior for both ANSI or Unicode applications, 149 | should return SQL_ERROR when the driver manager sets this connection 150 | attribute. When a unicode driver returns SQL_SUCCESS on this attribute, 151 | the driver manager treates ANSI and Unicode connections differently in 152 | connection pooling. 153 | */ 154 | #define SQL_ATTR_ANSI_APP 115 155 | #endif 156 | 157 | #if (ODBCVER >= 0x0380) 158 | #define SQL_ATTR_RESET_CONNECTION 116 159 | #define SQL_ATTR_ASYNC_DBC_FUNCTIONS_ENABLE 117 160 | #endif 161 | 162 | // Connection attribute 118 is defined in sqlspi.h 163 | 164 | #if (ODBCVER >= 0x0380) 165 | #define SQL_ATTR_ASYNC_DBC_EVENT 119 166 | #endif /* ODBCVER >= 0x0380 */ 167 | 168 | // Connection attribute 120 and 121 are defined in sqlspi.h 169 | 170 | #if (ODBCVER >= 0x0400) 171 | #define SQL_ATTR_CREDENTIALS 122 172 | #define SQL_ATTR_REFRESH_CONNECTION 123 173 | #endif /* ODBCVER >= 0x0400 */ 174 | 175 | /* SQL_CONNECT_OPT_DRVR_START is not meaningful for 3.0 driver */ 176 | #if (ODBCVER < 0x0300) 177 | #define SQL_CONNECT_OPT_DRVR_START 1000 178 | #endif /* ODBCVER < 0x0300 */ 179 | 180 | #if (ODBCVER < 0x0300) 181 | #define SQL_CONN_OPT_MAX SQL_PACKET_SIZE 182 | #define SQL_CONN_OPT_MIN SQL_ACCESS_MODE 183 | #endif /* ODBCVER < 0x0300 */ 184 | 185 | /* SQL_ACCESS_MODE options */ 186 | #define SQL_MODE_READ_WRITE 0UL 187 | #define SQL_MODE_READ_ONLY 1UL 188 | #define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE 189 | 190 | /* SQL_AUTOCOMMIT options */ 191 | #define SQL_AUTOCOMMIT_OFF 0UL 192 | #define SQL_AUTOCOMMIT_ON 1UL 193 | #define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON 194 | 195 | /* SQL_LOGIN_TIMEOUT options */ 196 | #define SQL_LOGIN_TIMEOUT_DEFAULT 15UL 197 | 198 | /* SQL_OPT_TRACE options */ 199 | #define SQL_OPT_TRACE_OFF 0UL 200 | #define SQL_OPT_TRACE_ON 1UL 201 | #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF 202 | #define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG" 203 | 204 | /* SQL_ODBC_CURSORS options */ 205 | #pragma deprecated(SQL_CUR_USE_IF_NEEDED,SQL_CUR_USE_ODBC) 206 | // SQL_CUR_USE_IF_NEEDED and SQL_CUR_USE_ODBC are deprecated. 207 | // Please use SQL_CUR_USE_DRIVER for cursor functionalities provided by drivers 208 | #define SQL_CUR_USE_IF_NEEDED 0UL 209 | #define SQL_CUR_USE_ODBC 1UL 210 | #define SQL_CUR_USE_DRIVER 2UL 211 | #define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER 212 | 213 | #if (ODBCVER >= 0x0300) 214 | /* values for SQL_ATTR_DISCONNECT_BEHAVIOR */ 215 | #define SQL_DB_RETURN_TO_POOL 0UL 216 | #define SQL_DB_DISCONNECT 1UL 217 | #define SQL_DB_DEFAULT SQL_DB_RETURN_TO_POOL 218 | 219 | /* values for SQL_ATTR_ENLIST_IN_DTC */ 220 | #define SQL_DTC_DONE 0L 221 | #endif /* ODBCVER >= 0x0300 */ 222 | 223 | /* values for SQL_ATTR_CONNECTION_DEAD */ 224 | #define SQL_CD_TRUE 1L /* Connection is closed/dead */ 225 | #define SQL_CD_FALSE 0L /* Connection is open/available */ 226 | 227 | /* values for SQL_ATTR_ANSI_APP */ 228 | #if (ODBCVER >= 0x0351) 229 | #define SQL_AA_TRUE 1L /* the application is an ANSI app */ 230 | #define SQL_AA_FALSE 0L /* the application is a Unicode app */ 231 | #endif 232 | 233 | /* values for SQL_ATTR_RESET_CONNECTION */ 234 | #if (ODBCVER >= 0x0380) 235 | #define SQL_RESET_CONNECTION_YES 1UL 236 | #endif 237 | 238 | /* values for SQL_ATTR_ASYNC_DBC_FUNCTIONS_ENABLE */ 239 | #if (ODBCVER >= 0x0380) 240 | #define SQL_ASYNC_DBC_ENABLE_ON 1UL 241 | #define SQL_ASYNC_DBC_ENABLE_OFF 0UL 242 | #define SQL_ASYNC_DBC_ENABLE_DEFAULT SQL_ASYNC_DBC_ENABLE_OFF 243 | #endif // ODBCVER >= 0x0380 244 | 245 | /* values for SQL_ATTR_REFRESH_CONNECTION */ 246 | #if (ODBCVER >= 0x0400) 247 | #define SQL_REFRESH_NOW -1 248 | #define SQL_REFRESH_AUTO 0 249 | #define SQL_REFRESH_MANUAL 1 250 | #endif /* ODBCVER >= 0x0400 */ 251 | 252 | /* statement attributes */ 253 | #define SQL_QUERY_TIMEOUT 0 254 | #define SQL_MAX_ROWS 1 255 | #define SQL_NOSCAN 2 256 | #define SQL_MAX_LENGTH 3 257 | #define SQL_ASYNC_ENABLE 4 258 | #define SQL_BIND_TYPE 5 259 | #define SQL_CURSOR_TYPE 6 260 | #define SQL_CONCURRENCY 7 261 | #define SQL_KEYSET_SIZE 8 262 | #define SQL_ROWSET_SIZE 9 263 | #define SQL_SIMULATE_CURSOR 10 264 | #define SQL_RETRIEVE_DATA 11 265 | #define SQL_USE_BOOKMARKS 12 266 | #define SQL_GET_BOOKMARK 13 /* GetStmtOption Only */ 267 | #define SQL_ROW_NUMBER 14 /* GetStmtOption Only */ 268 | 269 | /* statement attributes for ODBC 3.0 */ 270 | #if (ODBCVER >= 0x0300) 271 | #define SQL_ATTR_ASYNC_ENABLE SQL_ASYNC_ENABLE 272 | #define SQL_ATTR_CONCURRENCY SQL_CONCURRENCY 273 | #define SQL_ATTR_CURSOR_TYPE SQL_CURSOR_TYPE 274 | #define SQL_ATTR_ENABLE_AUTO_IPD 15 275 | #define SQL_ATTR_FETCH_BOOKMARK_PTR 16 276 | #define SQL_ATTR_KEYSET_SIZE SQL_KEYSET_SIZE 277 | #define SQL_ATTR_MAX_LENGTH SQL_MAX_LENGTH 278 | #define SQL_ATTR_MAX_ROWS SQL_MAX_ROWS 279 | #define SQL_ATTR_NOSCAN SQL_NOSCAN 280 | #define SQL_ATTR_PARAM_BIND_OFFSET_PTR 17 281 | #define SQL_ATTR_PARAM_BIND_TYPE 18 282 | #define SQL_ATTR_PARAM_OPERATION_PTR 19 283 | #define SQL_ATTR_PARAM_STATUS_PTR 20 284 | #define SQL_ATTR_PARAMS_PROCESSED_PTR 21 285 | #define SQL_ATTR_PARAMSET_SIZE 22 286 | #define SQL_ATTR_QUERY_TIMEOUT SQL_QUERY_TIMEOUT 287 | #define SQL_ATTR_RETRIEVE_DATA SQL_RETRIEVE_DATA 288 | #define SQL_ATTR_ROW_BIND_OFFSET_PTR 23 289 | #define SQL_ATTR_ROW_BIND_TYPE SQL_BIND_TYPE 290 | #define SQL_ATTR_ROW_NUMBER SQL_ROW_NUMBER /*GetStmtAttr*/ 291 | #define SQL_ATTR_ROW_OPERATION_PTR 24 292 | #define SQL_ATTR_ROW_STATUS_PTR 25 293 | #define SQL_ATTR_ROWS_FETCHED_PTR 26 294 | #define SQL_ATTR_ROW_ARRAY_SIZE 27 295 | #define SQL_ATTR_SIMULATE_CURSOR SQL_SIMULATE_CURSOR 296 | #define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS 297 | #endif /* ODBCVER >= 0x0300 */ 298 | 299 | #if (ODBCVER >= 0x0380) 300 | #define SQL_ATTR_ASYNC_STMT_EVENT 29 301 | #endif /* ODBCVER >= 0x0380 */ 302 | 303 | #if (ODBCVER >= 0x0400) 304 | #define SQL_ATTR_SAMPLE_SIZE 30 305 | #define SQL_ATTR_DYNAMIC_COLUMNS 31 306 | #define SQL_ATTR_TYPE_EXCEPTION_BEHAVIOR 32 307 | #define SQL_ATTR_LENGTH_EXCEPTION_BEHAVIOR 33 308 | #endif /* ODBCVER >= 0x0400 */ 309 | 310 | #if (ODBCVER < 0x0300) 311 | #define SQL_STMT_OPT_MAX SQL_ROW_NUMBER 312 | #define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT 313 | #endif /* ODBCVER < 0x0300 */ 314 | 315 | /* SQL_ATTR_TYPE_EXCEPTION_BEHAVIOR values */ 316 | #if (ODBCVER >= 0x0400) 317 | #define SQL_TE_ERROR 0x0001 318 | #define SQL_TE_CONTINUE 0x0002 319 | #define SQL_TE_REPORT 0x0003 320 | #endif /* ODBCVER >= 0x0400 */ 321 | 322 | /* SQL_ATTR_LENGTH_EXCEPTION_BEHAVIOR values */ 323 | #if (ODBCVER >= 0x0400) 324 | #define SQL_LE_CONTINUE 0x0001 325 | #define SQL_LE_REPORT 0x0002 326 | #endif /* ODBCVER >= 0x0400 */ 327 | 328 | /* New defines for SEARCHABLE column in SQLGetTypeInfo */ 329 | 330 | #if (ODBCVER >= 0x0300) 331 | #define SQL_COL_PRED_CHAR SQL_LIKE_ONLY 332 | #define SQL_COL_PRED_BASIC SQL_ALL_EXCEPT_LIKE 333 | #endif /* ODBCVER >= 0x0300 */ 334 | 335 | 336 | 337 | /* whether an attribute is a pointer or not */ 338 | #if (ODBCVER >= 0x0300) 339 | #define SQL_IS_POINTER (-4) 340 | #define SQL_IS_UINTEGER (-5) 341 | #define SQL_IS_INTEGER (-6) 342 | #define SQL_IS_USMALLINT (-7) 343 | #define SQL_IS_SMALLINT (-8) 344 | #endif /* ODBCVER >= 0x0300 */ 345 | 346 | /* the value of SQL_ATTR_PARAM_BIND_TYPE */ 347 | #if (ODBCVER >= 0x0300) 348 | #define SQL_PARAM_BIND_BY_COLUMN 0UL 349 | #define SQL_PARAM_BIND_TYPE_DEFAULT SQL_PARAM_BIND_BY_COLUMN 350 | #endif /* ODBCVER >= 0x0300 */ 351 | 352 | /* SQL_QUERY_TIMEOUT options */ 353 | #define SQL_QUERY_TIMEOUT_DEFAULT 0UL 354 | 355 | /* SQL_MAX_ROWS options */ 356 | #define SQL_MAX_ROWS_DEFAULT 0UL 357 | 358 | /* SQL_NOSCAN options */ 359 | #define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */ 360 | #define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */ 361 | #define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF 362 | 363 | /* SQL_MAX_LENGTH options */ 364 | #define SQL_MAX_LENGTH_DEFAULT 0UL 365 | 366 | /* values for SQL_ATTR_ASYNC_ENABLE */ 367 | #define SQL_ASYNC_ENABLE_OFF 0UL 368 | #define SQL_ASYNC_ENABLE_ON 1UL 369 | #define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF 370 | 371 | /* SQL_BIND_TYPE options */ 372 | #define SQL_BIND_BY_COLUMN 0UL 373 | #define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN /* Default value */ 374 | 375 | /* SQL_CONCURRENCY options */ 376 | #define SQL_CONCUR_READ_ONLY 1 377 | #define SQL_CONCUR_LOCK 2 378 | #define SQL_CONCUR_ROWVER 3 379 | #define SQL_CONCUR_VALUES 4 380 | #define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY /* Default value */ 381 | 382 | /* SQL_CURSOR_TYPE options */ 383 | #define SQL_CURSOR_FORWARD_ONLY 0UL 384 | #define SQL_CURSOR_KEYSET_DRIVEN 1UL 385 | #define SQL_CURSOR_DYNAMIC 2UL 386 | #define SQL_CURSOR_STATIC 3UL 387 | #define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY /* Default value */ 388 | 389 | /* SQL_ROWSET_SIZE options */ 390 | #define SQL_ROWSET_SIZE_DEFAULT 1UL 391 | 392 | /* SQL_KEYSET_SIZE options */ 393 | #define SQL_KEYSET_SIZE_DEFAULT 0UL 394 | 395 | /* SQL_SIMULATE_CURSOR options */ 396 | #define SQL_SC_NON_UNIQUE 0UL 397 | #define SQL_SC_TRY_UNIQUE 1UL 398 | #define SQL_SC_UNIQUE 2UL 399 | 400 | /* SQL_RETRIEVE_DATA options */ 401 | #define SQL_RD_OFF 0UL 402 | #define SQL_RD_ON 1UL 403 | #define SQL_RD_DEFAULT SQL_RD_ON 404 | 405 | /* SQL_USE_BOOKMARKS options */ 406 | #define SQL_UB_OFF 0UL 407 | #define SQL_UB_ON 01UL 408 | #define SQL_UB_DEFAULT SQL_UB_OFF 409 | 410 | /* New values for SQL_USE_BOOKMARKS attribute */ 411 | #if (ODBCVER >= 0x0300) 412 | #define SQL_UB_FIXED SQL_UB_ON 413 | #define SQL_UB_VARIABLE 2UL 414 | #endif /* ODBCVER >= 0x0300 */ 415 | 416 | /* extended descriptor field */ 417 | #if (ODBCVER >= 0x0300) 418 | #define SQL_DESC_ARRAY_SIZE 20 419 | #define SQL_DESC_ARRAY_STATUS_PTR 21 420 | #define SQL_DESC_AUTO_UNIQUE_VALUE SQL_COLUMN_AUTO_INCREMENT 421 | #define SQL_DESC_BASE_COLUMN_NAME 22 422 | #define SQL_DESC_BASE_TABLE_NAME 23 423 | #define SQL_DESC_BIND_OFFSET_PTR 24 424 | #define SQL_DESC_BIND_TYPE 25 425 | #define SQL_DESC_CASE_SENSITIVE SQL_COLUMN_CASE_SENSITIVE 426 | #define SQL_DESC_CATALOG_NAME SQL_COLUMN_QUALIFIER_NAME 427 | #define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE 428 | #define SQL_DESC_DATETIME_INTERVAL_PRECISION 26 429 | #define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE 430 | #define SQL_DESC_FIXED_PREC_SCALE SQL_COLUMN_MONEY 431 | #define SQL_DESC_LABEL SQL_COLUMN_LABEL 432 | #define SQL_DESC_LITERAL_PREFIX 27 433 | #define SQL_DESC_LITERAL_SUFFIX 28 434 | #define SQL_DESC_LOCAL_TYPE_NAME 29 435 | #define SQL_DESC_MAXIMUM_SCALE 30 436 | #define SQL_DESC_MINIMUM_SCALE 31 437 | #define SQL_DESC_NUM_PREC_RADIX 32 438 | #define SQL_DESC_PARAMETER_TYPE 33 439 | #define SQL_DESC_ROWS_PROCESSED_PTR 34 440 | #if (ODBCVER >= 0x0350) 441 | #define SQL_DESC_ROWVER 35 442 | #endif /* ODBCVER >= 0x0350 */ 443 | #define SQL_DESC_SCHEMA_NAME SQL_COLUMN_OWNER_NAME 444 | #define SQL_DESC_SEARCHABLE SQL_COLUMN_SEARCHABLE 445 | #define SQL_DESC_TYPE_NAME SQL_COLUMN_TYPE_NAME 446 | #define SQL_DESC_TABLE_NAME SQL_COLUMN_TABLE_NAME 447 | #define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED 448 | #define SQL_DESC_UPDATABLE SQL_COLUMN_UPDATABLE 449 | #endif /* ODBCVER >= 0x0300 */ 450 | 451 | #if (ODBCVER >= 0x0400) 452 | #define SQL_DESC_MIME_TYPE 36 453 | #endif /* ODBCVER >= 0x0400 */ 454 | 455 | 456 | /* defines for diagnostics fields */ 457 | #if (ODBCVER >= 0x0300) 458 | #define SQL_DIAG_CURSOR_ROW_COUNT (-1249) 459 | #define SQL_DIAG_ROW_NUMBER (-1248) 460 | #define SQL_DIAG_COLUMN_NUMBER (-1247) 461 | #endif /* ODBCVER >= 0x0300 */ 462 | 463 | /* SQL extended datatypes */ 464 | #define SQL_DATE 9 465 | #if (ODBCVER >= 0x0300) 466 | #define SQL_INTERVAL 10 467 | #endif /* ODBCVER >= 0x0300 */ 468 | #define SQL_TIME 10 469 | #define SQL_TIMESTAMP 11 470 | #define SQL_LONGVARCHAR (-1) 471 | #define SQL_BINARY (-2) 472 | #define SQL_VARBINARY (-3) 473 | #define SQL_LONGVARBINARY (-4) 474 | #define SQL_BIGINT (-5) 475 | #define SQL_TINYINT (-6) 476 | #define SQL_BIT (-7) 477 | #if (ODBCVER >= 0x0350) 478 | #define SQL_GUID (-11) 479 | #endif /* ODBCVER >= 0x0350 */ 480 | 481 | #if (ODBCVER >= 0x0300) 482 | /* interval code */ 483 | #define SQL_CODE_YEAR 1 484 | #define SQL_CODE_MONTH 2 485 | #define SQL_CODE_DAY 3 486 | #define SQL_CODE_HOUR 4 487 | #define SQL_CODE_MINUTE 5 488 | #define SQL_CODE_SECOND 6 489 | #define SQL_CODE_YEAR_TO_MONTH 7 490 | #define SQL_CODE_DAY_TO_HOUR 8 491 | #define SQL_CODE_DAY_TO_MINUTE 9 492 | #define SQL_CODE_DAY_TO_SECOND 10 493 | #define SQL_CODE_HOUR_TO_MINUTE 11 494 | #define SQL_CODE_HOUR_TO_SECOND 12 495 | #define SQL_CODE_MINUTE_TO_SECOND 13 496 | 497 | #define SQL_INTERVAL_YEAR (100 + SQL_CODE_YEAR) 498 | #define SQL_INTERVAL_MONTH (100 + SQL_CODE_MONTH) 499 | #define SQL_INTERVAL_DAY (100 + SQL_CODE_DAY) 500 | #define SQL_INTERVAL_HOUR (100 + SQL_CODE_HOUR) 501 | #define SQL_INTERVAL_MINUTE (100 + SQL_CODE_MINUTE) 502 | #define SQL_INTERVAL_SECOND (100 + SQL_CODE_SECOND) 503 | #define SQL_INTERVAL_YEAR_TO_MONTH (100 + SQL_CODE_YEAR_TO_MONTH) 504 | #define SQL_INTERVAL_DAY_TO_HOUR (100 + SQL_CODE_DAY_TO_HOUR) 505 | #define SQL_INTERVAL_DAY_TO_MINUTE (100 + SQL_CODE_DAY_TO_MINUTE) 506 | #define SQL_INTERVAL_DAY_TO_SECOND (100 + SQL_CODE_DAY_TO_SECOND) 507 | #define SQL_INTERVAL_HOUR_TO_MINUTE (100 + SQL_CODE_HOUR_TO_MINUTE) 508 | #define SQL_INTERVAL_HOUR_TO_SECOND (100 + SQL_CODE_HOUR_TO_SECOND) 509 | #define SQL_INTERVAL_MINUTE_TO_SECOND (100 + SQL_CODE_MINUTE_TO_SECOND) 510 | 511 | #else 512 | #define SQL_INTERVAL_YEAR (-80) 513 | #define SQL_INTERVAL_MONTH (-81) 514 | #define SQL_INTERVAL_YEAR_TO_MONTH (-82) 515 | #define SQL_INTERVAL_DAY (-83) 516 | #define SQL_INTERVAL_HOUR (-84) 517 | #define SQL_INTERVAL_MINUTE (-85) 518 | #define SQL_INTERVAL_SECOND (-86) 519 | #define SQL_INTERVAL_DAY_TO_HOUR (-87) 520 | #define SQL_INTERVAL_DAY_TO_MINUTE (-88) 521 | #define SQL_INTERVAL_DAY_TO_SECOND (-89) 522 | #define SQL_INTERVAL_HOUR_TO_MINUTE (-90) 523 | #define SQL_INTERVAL_HOUR_TO_SECOND (-91) 524 | #define SQL_INTERVAL_MINUTE_TO_SECOND (-92) 525 | #endif /* ODBCVER >= 0x0300 */ 526 | 527 | 528 | #if (ODBCVER <= 0x0300) 529 | #define SQL_UNICODE (-95) 530 | #define SQL_UNICODE_VARCHAR (-96) 531 | #define SQL_UNICODE_LONGVARCHAR (-97) 532 | #define SQL_UNICODE_CHAR SQL_UNICODE 533 | #else 534 | /* The previous definitions for SQL_UNICODE_ are historical and obsolete */ 535 | 536 | #define SQL_UNICODE SQL_WCHAR 537 | 538 | #define SQL_UNICODE_VARCHAR SQL_WVARCHAR 539 | #define SQL_UNICODE_LONGVARCHAR SQL_WLONGVARCHAR 540 | #define SQL_UNICODE_CHAR SQL_WCHAR 541 | #endif 542 | 543 | #if (ODBCVER < 0x0300) 544 | #define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR 545 | #define SQL_TYPE_DRIVER_END SQL_UNICODE_LONGVARCHAR 546 | #endif /* ODBCVER < 0x0300 */ 547 | 548 | /* C datatype to SQL datatype mapping SQL types 549 | ------------------- */ 550 | #define SQL_C_CHAR SQL_CHAR /* CHAR, VARCHAR, DECIMAL, NUMERIC */ 551 | #define SQL_C_LONG SQL_INTEGER /* INTEGER */ 552 | #define SQL_C_SHORT SQL_SMALLINT /* SMALLINT */ 553 | #define SQL_C_FLOAT SQL_REAL /* REAL */ 554 | #define SQL_C_DOUBLE SQL_DOUBLE /* FLOAT, DOUBLE */ 555 | #if (ODBCVER >= 0x0300) 556 | #define SQL_C_NUMERIC SQL_NUMERIC 557 | #endif /* ODBCVER >= 0x0300 */ 558 | #define SQL_C_DEFAULT 99 559 | 560 | #define SQL_SIGNED_OFFSET (-20) 561 | #define SQL_UNSIGNED_OFFSET (-22) 562 | 563 | /* C datatype to SQL datatype mapping */ 564 | #define SQL_C_DATE SQL_DATE 565 | #define SQL_C_TIME SQL_TIME 566 | #define SQL_C_TIMESTAMP SQL_TIMESTAMP 567 | #if (ODBCVER >= 0x0300) 568 | #define SQL_C_TYPE_DATE SQL_TYPE_DATE 569 | #define SQL_C_TYPE_TIME SQL_TYPE_TIME 570 | #define SQL_C_TYPE_TIMESTAMP SQL_TYPE_TIMESTAMP 571 | #if (ODBCVER >= 0x0400) 572 | #define SQL_C_TYPE_TIME_WITH_TIMEZONE SQL_TYPE_TIME_WITH_TIMEZONE 573 | #define SQL_C_TYPE_TIMESTAMP_WITH_TIMEZONE SQL_TYPE_TIMESTAMP_WITH_TIMEZONE 574 | #endif /* ODBCVER >= 0x0400 */ 575 | #define SQL_C_INTERVAL_YEAR SQL_INTERVAL_YEAR 576 | #define SQL_C_INTERVAL_MONTH SQL_INTERVAL_MONTH 577 | #define SQL_C_INTERVAL_DAY SQL_INTERVAL_DAY 578 | #define SQL_C_INTERVAL_HOUR SQL_INTERVAL_HOUR 579 | #define SQL_C_INTERVAL_MINUTE SQL_INTERVAL_MINUTE 580 | #define SQL_C_INTERVAL_SECOND SQL_INTERVAL_SECOND 581 | #define SQL_C_INTERVAL_YEAR_TO_MONTH SQL_INTERVAL_YEAR_TO_MONTH 582 | #define SQL_C_INTERVAL_DAY_TO_HOUR SQL_INTERVAL_DAY_TO_HOUR 583 | #define SQL_C_INTERVAL_DAY_TO_MINUTE SQL_INTERVAL_DAY_TO_MINUTE 584 | #define SQL_C_INTERVAL_DAY_TO_SECOND SQL_INTERVAL_DAY_TO_SECOND 585 | #define SQL_C_INTERVAL_HOUR_TO_MINUTE SQL_INTERVAL_HOUR_TO_MINUTE 586 | #define SQL_C_INTERVAL_HOUR_TO_SECOND SQL_INTERVAL_HOUR_TO_SECOND 587 | #define SQL_C_INTERVAL_MINUTE_TO_SECOND SQL_INTERVAL_MINUTE_TO_SECOND 588 | #endif /* ODBCVER >= 0x0300 */ 589 | #define SQL_C_BINARY SQL_BINARY 590 | #define SQL_C_BIT SQL_BIT 591 | #if (ODBCVER >= 0x0300) 592 | #define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */ 593 | #define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */ 594 | #endif /* ODBCVER >= 0x0300 */ 595 | #define SQL_C_TINYINT SQL_TINYINT 596 | #define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET) /* SIGNED INTEGER */ 597 | #define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET) /* SIGNED SMALLINT */ 598 | #define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET) /* SIGNED TINYINT */ 599 | #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/ 600 | #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/ 601 | #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/ 602 | 603 | #ifdef _WIN64 604 | #define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */ 605 | #else 606 | #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */ 607 | #endif 608 | 609 | #if (ODBCVER >= 0x0350) 610 | #define SQL_C_GUID SQL_GUID 611 | #endif /* ODBCVER >= 0x0350 */ 612 | 613 | #define SQL_TYPE_NULL 0 614 | #if (ODBCVER < 0x0300) 615 | #define SQL_TYPE_MIN SQL_BIT 616 | #define SQL_TYPE_MAX SQL_VARCHAR 617 | #endif 618 | 619 | // base value of driver-specific C-Type (max is 0x7fff) 620 | // define driver-specific C-Type, named as SQL_DRIVER_C_TYPE_BASE, 621 | // SQL_DRIVER_C_TYPE_BASE+1, SQL_DRIVER_C_TYPE_BASE+2, etc. 622 | #if (ODBCVER >= 0x380) 623 | #define SQL_DRIVER_C_TYPE_BASE 0x4000 624 | #endif 625 | 626 | // base value of driver-specific fields/attributes (max are 0x7fff [16-bit] or 0x00007fff [32-bit]) 627 | // define driver-specific SQL-Type, named as SQL_DRIVER_SQL_TYPE_BASE, 628 | // SQL_DRIVER_SQL_TYPE_BASE+1, SQL_DRIVER_SQL_TYPE_BASE+2, etc. 629 | // 630 | // Please note that there is no runtime change in this version of DM. 631 | // However, we suggest that driver manufacturers adhere to this range 632 | // as future versions of the DM may enforce these constraints 633 | #if (ODBCVER >= 0x380) 634 | #define SQL_DRIVER_SQL_TYPE_BASE 0x4000 635 | #define SQL_DRIVER_DESC_FIELD_BASE 0x4000 636 | #define SQL_DRIVER_DIAG_FIELD_BASE 0x4000 637 | #define SQL_DRIVER_INFO_TYPE_BASE 0x4000 638 | #define SQL_DRIVER_CONN_ATTR_BASE 0x00004000 // 32-bit 639 | #define SQL_DRIVER_STMT_ATTR_BASE 0x00004000 // 32-bit 640 | #endif 641 | 642 | #if (ODBCVER >= 0x0300) 643 | #define SQL_C_VARBOOKMARK SQL_C_BINARY 644 | #endif /* ODBCVER >= 0x0300 */ 645 | 646 | /* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */ 647 | #if (ODBCVER >= 0x0300) 648 | #define SQL_NO_ROW_NUMBER (-1) 649 | #define SQL_NO_COLUMN_NUMBER (-1) 650 | #define SQL_ROW_NUMBER_UNKNOWN (-2) 651 | #define SQL_COLUMN_NUMBER_UNKNOWN (-2) 652 | #endif 653 | 654 | /* SQLBindParameter extensions */ 655 | #define SQL_DEFAULT_PARAM (-5) 656 | #define SQL_IGNORE (-6) 657 | #if (ODBCVER >= 0x0300) 658 | #define SQL_COLUMN_IGNORE SQL_IGNORE 659 | #endif /* ODBCVER >= 0x0300 */ 660 | #define SQL_LEN_DATA_AT_EXEC_OFFSET (-100) 661 | #define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET) 662 | 663 | /* binary length for driver specific attributes */ 664 | #define SQL_LEN_BINARY_ATTR_OFFSET (-100) 665 | #define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET) 666 | 667 | /* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter 668 | */ 669 | #define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT 670 | #define SQL_SETPARAM_VALUE_MAX (-1L) 671 | 672 | /* Extended length/indicator values Values */ 673 | #if (ODBCVER >= 0x0400) 674 | #define SQL_DATA_UNAVAILABLE SQL_IGNORE 675 | #define SQL_DATA_AT_FETCH SQL_DATA_AT_EXEC 676 | #define SQL_TYPE_EXCEPTION (-20) 677 | #endif /* ODBCVER >= 0x400 */ 678 | 679 | /* SQLColAttributes defines */ 680 | #define SQL_COLUMN_COUNT 0 681 | #define SQL_COLUMN_NAME 1 682 | #define SQL_COLUMN_TYPE 2 683 | #define SQL_COLUMN_LENGTH 3 684 | #define SQL_COLUMN_PRECISION 4 685 | #define SQL_COLUMN_SCALE 5 686 | #define SQL_COLUMN_DISPLAY_SIZE 6 687 | #define SQL_COLUMN_NULLABLE 7 688 | #define SQL_COLUMN_UNSIGNED 8 689 | #define SQL_COLUMN_MONEY 9 690 | #define SQL_COLUMN_UPDATABLE 10 691 | #define SQL_COLUMN_AUTO_INCREMENT 11 692 | #define SQL_COLUMN_CASE_SENSITIVE 12 693 | #define SQL_COLUMN_SEARCHABLE 13 694 | #define SQL_COLUMN_TYPE_NAME 14 695 | #define SQL_COLUMN_TABLE_NAME 15 696 | #define SQL_COLUMN_OWNER_NAME 16 697 | #define SQL_COLUMN_QUALIFIER_NAME 17 698 | #define SQL_COLUMN_LABEL 18 699 | #define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL 700 | #if (ODBCVER < 0x0300) 701 | #define SQL_COLUMN_DRIVER_START 1000 702 | #endif /* ODBCVER < 0x0300 */ 703 | 704 | #define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT 705 | 706 | /* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */ 707 | #define SQL_ATTR_READONLY 0 708 | #define SQL_ATTR_WRITE 1 709 | #define SQL_ATTR_READWRITE_UNKNOWN 2 710 | 711 | /* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */ 712 | /* These are also used by SQLGetInfo */ 713 | #define SQL_UNSEARCHABLE 0 714 | #define SQL_LIKE_ONLY 1 715 | #define SQL_ALL_EXCEPT_LIKE 2 716 | #define SQL_SEARCHABLE 3 717 | #define SQL_PRED_SEARCHABLE SQL_SEARCHABLE 718 | 719 | 720 | /* Special return values for SQLGetData */ 721 | #define SQL_NO_TOTAL (-4) 722 | 723 | /********************************************/ 724 | /* SQLGetFunctions: additional values for */ 725 | /* fFunction to represent functions that */ 726 | /* are not in the X/Open spec. */ 727 | /********************************************/ 728 | 729 | #if (ODBCVER >= 0x0300) 730 | #define SQL_API_SQLALLOCHANDLESTD 73 731 | #define SQL_API_SQLBULKOPERATIONS 24 732 | #endif /* ODBCVER >= 0x0300 */ 733 | #define SQL_API_SQLBINDPARAMETER 72 734 | #define SQL_API_SQLBROWSECONNECT 55 735 | #define SQL_API_SQLCOLATTRIBUTES 6 736 | #define SQL_API_SQLCOLUMNPRIVILEGES 56 737 | #define SQL_API_SQLDESCRIBEPARAM 58 738 | #define SQL_API_SQLDRIVERCONNECT 41 739 | #define SQL_API_SQLDRIVERS 71 740 | #define SQL_API_SQLEXTENDEDFETCH 59 741 | #define SQL_API_SQLFOREIGNKEYS 60 742 | #define SQL_API_SQLMORERESULTS 61 743 | #define SQL_API_SQLNATIVESQL 62 744 | #define SQL_API_SQLNUMPARAMS 63 745 | #define SQL_API_SQLPARAMOPTIONS 64 746 | #define SQL_API_SQLPRIMARYKEYS 65 747 | #define SQL_API_SQLPROCEDURECOLUMNS 66 748 | #define SQL_API_SQLPROCEDURES 67 749 | #define SQL_API_SQLSETPOS 68 750 | #define SQL_API_SQLSETSCROLLOPTIONS 69 751 | #define SQL_API_SQLTABLEPRIVILEGES 70 752 | 753 | #if (ODBCVER >= 0x0400) 754 | #define SQL_API_SQLGETNESTEDHANDLE 74 755 | #define SQL_API_SQLSTRUCTUREDTYPES 75 756 | #define SQL_API_SQLSTRUCTUREDTYPECOLUMNS 76 757 | #define SQL_API_SQLNEXTCOLUMN 77 758 | #endif /* ODBCVER >= 0x0400 */ 759 | 760 | /*-------------------------------------------*/ 761 | /* SQL_EXT_API_LAST is not useful with ODBC */ 762 | /* version 3.0 because some of the values */ 763 | /* from X/Open are in the 10000 range. */ 764 | /*-------------------------------------------*/ 765 | 766 | #if (ODBCVER < 0x0300) 767 | #define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER 768 | #define SQL_NUM_FUNCTIONS 23 769 | #define SQL_EXT_API_START 40 770 | #define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1) 771 | #endif 772 | 773 | /*--------------------------------------------*/ 774 | /* SQL_API_ALL_FUNCTIONS returns an array */ 775 | /* of 'booleans' representing whether a */ 776 | /* function is implemented by the driver. */ 777 | /* */ 778 | /* CAUTION: Only functions defined in ODBC */ 779 | /* version 2.0 and earlier are returned, the */ 780 | /* new high-range function numbers defined by */ 781 | /* X/Open break this scheme. See the new */ 782 | /* method -- SQL_API_ODBC3_ALL_FUNCTIONS */ 783 | /*--------------------------------------------*/ 784 | 785 | #define SQL_API_ALL_FUNCTIONS 0 /* See CAUTION above */ 786 | 787 | /*----------------------------------------------*/ 788 | /* 2.X drivers export a dummy function with */ 789 | /* ordinal number SQL_API_LOADBYORDINAL to speed*/ 790 | /* loading under the windows operating system. */ 791 | /* */ 792 | /* CAUTION: Loading by ordinal is not supported */ 793 | /* for 3.0 and above drivers. */ 794 | /*----------------------------------------------*/ 795 | 796 | #define SQL_API_LOADBYORDINAL 199 /* See CAUTION above */ 797 | 798 | /*----------------------------------------------*/ 799 | /* SQL_API_ODBC3_ALL_FUNCTIONS */ 800 | /* This returns a bitmap, which allows us to */ 801 | /* handle the higher-valued function numbers. */ 802 | /* Use SQL_FUNC_EXISTS(bitmap,function_number) */ 803 | /* to determine if the function exists. */ 804 | /*----------------------------------------------*/ 805 | 806 | 807 | #if (ODBCVER >= 0x0300) 808 | #define SQL_API_ODBC3_ALL_FUNCTIONS 999 809 | #define SQL_API_ODBC3_ALL_FUNCTIONS_SIZE 250 /* array of 250 words */ 810 | 811 | #define SQL_FUNC_EXISTS(pfExists, uwAPI) \ 812 | ((*(((UWORD*) (pfExists)) + ((uwAPI) >> 4)) \ 813 | & (1 << ((uwAPI) & 0x000F)) \ 814 | ) ? SQL_TRUE : SQL_FALSE \ 815 | ) 816 | #endif /* ODBCVER >= 0x0300 */ 817 | 818 | 819 | /************************************************/ 820 | /* Extended definitions for SQLGetInfo */ 821 | /************************************************/ 822 | 823 | /*---------------------------------*/ 824 | /* Values in ODBC 2.0 that are not */ 825 | /* in the X/Open spec */ 826 | /*---------------------------------*/ 827 | 828 | #define SQL_INFO_FIRST 0 829 | #define SQL_ACTIVE_CONNECTIONS 0 /* MAX_DRIVER_CONNECTIONS */ 830 | #define SQL_ACTIVE_STATEMENTS 1 /* MAX_CONCURRENT_ACTIVITIES */ 831 | #define SQL_DRIVER_HDBC 3 832 | #define SQL_DRIVER_HENV 4 833 | #define SQL_DRIVER_HSTMT 5 834 | #define SQL_DRIVER_NAME 6 835 | #define SQL_DRIVER_VER 7 836 | #define SQL_ODBC_API_CONFORMANCE 9 837 | #define SQL_ODBC_VER 10 838 | #define SQL_ROW_UPDATES 11 839 | #define SQL_ODBC_SAG_CLI_CONFORMANCE 12 840 | #define SQL_ODBC_SQL_CONFORMANCE 15 841 | #define SQL_PROCEDURES 21 842 | #define SQL_CONCAT_NULL_BEHAVIOR 22 843 | #define SQL_CURSOR_ROLLBACK_BEHAVIOR 24 844 | #define SQL_EXPRESSIONS_IN_ORDERBY 27 845 | #define SQL_MAX_OWNER_NAME_LEN 32 /* MAX_SCHEMA_NAME_LEN */ 846 | #define SQL_MAX_PROCEDURE_NAME_LEN 33 847 | #define SQL_MAX_QUALIFIER_NAME_LEN 34 /* MAX_CATALOG_NAME_LEN */ 848 | #define SQL_MULT_RESULT_SETS 36 849 | #define SQL_MULTIPLE_ACTIVE_TXN 37 850 | #define SQL_OUTER_JOINS 38 851 | #define SQL_OWNER_TERM 39 852 | #define SQL_PROCEDURE_TERM 40 853 | #define SQL_QUALIFIER_NAME_SEPARATOR 41 854 | #define SQL_QUALIFIER_TERM 42 855 | #define SQL_SCROLL_OPTIONS 44 856 | #define SQL_TABLE_TERM 45 857 | #define SQL_CONVERT_FUNCTIONS 48 858 | #define SQL_NUMERIC_FUNCTIONS 49 859 | #define SQL_STRING_FUNCTIONS 50 860 | #define SQL_SYSTEM_FUNCTIONS 51 861 | #define SQL_TIMEDATE_FUNCTIONS 52 862 | #define SQL_CONVERT_BIGINT 53 863 | #define SQL_CONVERT_BINARY 54 864 | #define SQL_CONVERT_BIT 55 865 | #define SQL_CONVERT_CHAR 56 866 | #define SQL_CONVERT_DATE 57 867 | #define SQL_CONVERT_DECIMAL 58 868 | #define SQL_CONVERT_DOUBLE 59 869 | #define SQL_CONVERT_FLOAT 60 870 | #define SQL_CONVERT_INTEGER 61 871 | #define SQL_CONVERT_LONGVARCHAR 62 872 | #define SQL_CONVERT_NUMERIC 63 873 | #define SQL_CONVERT_REAL 64 874 | #define SQL_CONVERT_SMALLINT 65 875 | #define SQL_CONVERT_TIME 66 876 | #define SQL_CONVERT_TIMESTAMP 67 877 | #define SQL_CONVERT_TINYINT 68 878 | #define SQL_CONVERT_VARBINARY 69 879 | #define SQL_CONVERT_VARCHAR 70 880 | #define SQL_CONVERT_LONGVARBINARY 71 881 | #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */ 882 | #define SQL_CORRELATION_NAME 74 883 | #define SQL_NON_NULLABLE_COLUMNS 75 884 | #define SQL_DRIVER_HLIB 76 885 | #define SQL_DRIVER_ODBC_VER 77 886 | #define SQL_LOCK_TYPES 78 887 | #define SQL_POS_OPERATIONS 79 888 | #define SQL_POSITIONED_STATEMENTS 80 889 | #define SQL_BOOKMARK_PERSISTENCE 82 890 | #define SQL_STATIC_SENSITIVITY 83 891 | #define SQL_FILE_USAGE 84 892 | #define SQL_COLUMN_ALIAS 87 893 | #define SQL_GROUP_BY 88 894 | #define SQL_KEYWORDS 89 895 | #define SQL_OWNER_USAGE 91 896 | #define SQL_QUALIFIER_USAGE 92 897 | #define SQL_QUOTED_IDENTIFIER_CASE 93 898 | #define SQL_SUBQUERIES 95 899 | #define SQL_UNION 96 900 | #define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103 901 | #define SQL_MAX_CHAR_LITERAL_LEN 108 902 | #define SQL_TIMEDATE_ADD_INTERVALS 109 903 | #define SQL_TIMEDATE_DIFF_INTERVALS 110 904 | #define SQL_NEED_LONG_DATA_LEN 111 905 | #define SQL_MAX_BINARY_LITERAL_LEN 112 906 | #define SQL_LIKE_ESCAPE_CLAUSE 113 907 | #define SQL_QUALIFIER_LOCATION 114 908 | 909 | #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300) 910 | #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ 911 | #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */ 912 | 913 | /*----------------------------------------------*/ 914 | /* SQL_INFO_LAST and SQL_INFO_DRIVER_START are */ 915 | /* not useful anymore, because X/Open has */ 916 | /* values in the 10000 range. You */ 917 | /* must contact X/Open directly to get a range */ 918 | /* of numbers for driver-specific values. */ 919 | /*----------------------------------------------*/ 920 | 921 | #if (ODBCVER < 0x0300) 922 | #define SQL_INFO_LAST SQL_QUALIFIER_LOCATION 923 | #define SQL_INFO_DRIVER_START 1000 924 | #endif /* ODBCVER < 0x0300 */ 925 | 926 | /*-----------------------------------------------*/ 927 | /* ODBC 3.0 SQLGetInfo values that are not part */ 928 | /* of the X/Open standard at this time. X/Open */ 929 | /* standard values are in sql.h. */ 930 | /*-----------------------------------------------*/ 931 | 932 | #if (ODBCVER >= 0x0300) 933 | #define SQL_ACTIVE_ENVIRONMENTS 116 934 | #define SQL_ALTER_DOMAIN 117 935 | 936 | #define SQL_SQL_CONFORMANCE 118 937 | #define SQL_DATETIME_LITERALS 119 938 | 939 | #define SQL_ASYNC_MODE 10021 /* new X/Open spec */ 940 | #define SQL_BATCH_ROW_COUNT 120 941 | #define SQL_BATCH_SUPPORT 121 942 | #define SQL_CATALOG_LOCATION SQL_QUALIFIER_LOCATION 943 | #define SQL_CATALOG_NAME_SEPARATOR SQL_QUALIFIER_NAME_SEPARATOR 944 | #define SQL_CATALOG_TERM SQL_QUALIFIER_TERM 945 | #define SQL_CATALOG_USAGE SQL_QUALIFIER_USAGE 946 | #define SQL_CONVERT_WCHAR 122 947 | #define SQL_CONVERT_INTERVAL_DAY_TIME 123 948 | #define SQL_CONVERT_INTERVAL_YEAR_MONTH 124 949 | #define SQL_CONVERT_WLONGVARCHAR 125 950 | #define SQL_CONVERT_WVARCHAR 126 951 | #define SQL_CREATE_ASSERTION 127 952 | #define SQL_CREATE_CHARACTER_SET 128 953 | #define SQL_CREATE_COLLATION 129 954 | #define SQL_CREATE_DOMAIN 130 955 | #define SQL_CREATE_SCHEMA 131 956 | #define SQL_CREATE_TABLE 132 957 | #define SQL_CREATE_TRANSLATION 133 958 | #define SQL_CREATE_VIEW 134 959 | #define SQL_DRIVER_HDESC 135 960 | #define SQL_DROP_ASSERTION 136 961 | #define SQL_DROP_CHARACTER_SET 137 962 | #define SQL_DROP_COLLATION 138 963 | #define SQL_DROP_DOMAIN 139 964 | #define SQL_DROP_SCHEMA 140 965 | #define SQL_DROP_TABLE 141 966 | #define SQL_DROP_TRANSLATION 142 967 | #define SQL_DROP_VIEW 143 968 | #define SQL_DYNAMIC_CURSOR_ATTRIBUTES1 144 969 | #define SQL_DYNAMIC_CURSOR_ATTRIBUTES2 145 970 | #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146 971 | #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 147 972 | #define SQL_INDEX_KEYWORDS 148 973 | #define SQL_INFO_SCHEMA_VIEWS 149 974 | #define SQL_KEYSET_CURSOR_ATTRIBUTES1 150 975 | #define SQL_KEYSET_CURSOR_ATTRIBUTES2 151 976 | #define SQL_MAX_ASYNC_CONCURRENT_STATEMENTS 10022 /* new X/Open spec */ 977 | #define SQL_ODBC_INTERFACE_CONFORMANCE 152 978 | #define SQL_PARAM_ARRAY_ROW_COUNTS 153 979 | #define SQL_PARAM_ARRAY_SELECTS 154 980 | #define SQL_SCHEMA_TERM SQL_OWNER_TERM 981 | #define SQL_SCHEMA_USAGE SQL_OWNER_USAGE 982 | #define SQL_SQL92_DATETIME_FUNCTIONS 155 983 | #define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156 984 | #define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157 985 | #define SQL_SQL92_GRANT 158 986 | #define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 159 987 | #define SQL_SQL92_PREDICATES 160 988 | #define SQL_SQL92_RELATIONAL_JOIN_OPERATORS 161 989 | #define SQL_SQL92_REVOKE 162 990 | #define SQL_SQL92_ROW_VALUE_CONSTRUCTOR 163 991 | #define SQL_SQL92_STRING_FUNCTIONS 164 992 | #define SQL_SQL92_VALUE_EXPRESSIONS 165 993 | #define SQL_STANDARD_CLI_CONFORMANCE 166 994 | #define SQL_STATIC_CURSOR_ATTRIBUTES1 167 995 | #define SQL_STATIC_CURSOR_ATTRIBUTES2 168 996 | 997 | #define SQL_AGGREGATE_FUNCTIONS 169 998 | #define SQL_DDL_INDEX 170 999 | #define SQL_DM_VER 171 1000 | #define SQL_INSERT_STATEMENT 172 1001 | #define SQL_CONVERT_GUID 173 1002 | #define SQL_UNION_STATEMENT SQL_UNION 1003 | 1004 | #if (ODBCVER >= 0x0400) 1005 | #define SQL_SCHEMA_INFERENCE 174 1006 | #define SQL_BINARY_FUNCTIONS 175 1007 | #define SQL_ISO_STRING_FUNCTIONS 176 1008 | #define SQL_ISO_BINARY_FUNCTIONS 177 1009 | #define SQL_LIMIT_ESCAPE_CLAUSE 178 1010 | #define SQL_NATIVE_ESCAPE_CLAUSE 179 1011 | #define SQL_RETURN_ESCAPE_CLAUSE 180 1012 | #define SQL_FORMAT_ESCAPE_CLAUSE 181 1013 | #define SQL_ISO_DATETIME_FUNCTIONS SQL_SQL92_DATETIME_FUNCTIONS 1014 | #define SQL_ISO_FOREIGN_KEY_DELETE_RULE SQL_SQL92_FOREIGN_KEY_DELETE_RULE 1015 | #define SQL_ISO_FOREIGN_KEY_UPDATE_RULE SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 1016 | #define SQL_ISO_GRANT SQL_SQL92_GRANT 1017 | #define SQL_ISO_NUMERIC_VALUE_FUNCTIONS SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 1018 | #define SQL_ISO_PREDICATES SQL_SQL92_PREDICATES 1019 | #define SQL_ISO_RELATIONAL_JOIN_OPERATORS SQL_SQL92_RELATIONAL_JOIN_OPERATORS 1020 | #define SQL_ISO_REVOKE SQL_SQL92_REVOKE 1021 | #define SQL_ISO_ROW_VALUE_CONSTRUCTOR SQL_SQL92_ROW_VALUE_CONSTRUCTOR 1022 | #define SQL_ISO_VALUE_EXPRESSIONS SQL_SQL92_VALUE_EXPRESSIONS 1023 | #endif /* ODBCVER >= 0x0400 */ 1024 | 1025 | #if (ODBCVER >= 0x0380) 1026 | // Info Types 1027 | #define SQL_ASYNC_DBC_FUNCTIONS 10023 1028 | #endif // ODBCVER >= 0x0380 1029 | 1030 | #define SQL_DRIVER_AWARE_POOLING_SUPPORTED 10024 1031 | 1032 | #if (ODBCVER >= 0x0380) 1033 | #define SQL_ASYNC_NOTIFICATION 10025 1034 | 1035 | // Possible values for SQL_ASYNC_NOTIFICATION 1036 | #define SQL_ASYNC_NOTIFICATION_NOT_CAPABLE 0x00000000L 1037 | #define SQL_ASYNC_NOTIFICATION_CAPABLE 0x00000001L 1038 | #endif // ODBCVER >= 0x0380 1039 | 1040 | #endif /* ODBCVER >= 0x0300 */ 1041 | 1042 | #define SQL_DTC_TRANSITION_COST 1750 1043 | 1044 | /* SQL_ALTER_TABLE bitmasks */ 1045 | #if (ODBCVER >= 0x0300) 1046 | /* the following 5 bitmasks are defined in sql.h 1047 | *#define SQL_AT_ADD_COLUMN 0x00000001L 1048 | *#define SQL_AT_DROP_COLUMN 0x00000002L 1049 | *#define SQL_AT_ADD_CONSTRAINT 0x00000008L 1050 | */ 1051 | #define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L 1052 | #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L 1053 | #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L 1054 | #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L 1055 | #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L 1056 | #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L 1057 | #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L 1058 | #define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L 1059 | #define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L 1060 | #define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L 1061 | #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L 1062 | #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L 1063 | #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L 1064 | #define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L 1065 | #define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L 1066 | #endif /* ODBCVER >= 0x0300 */ 1067 | 1068 | /* SQL_CONVERT_* return value bitmasks */ 1069 | 1070 | #define SQL_CVT_CHAR 0x00000001L 1071 | #define SQL_CVT_NUMERIC 0x00000002L 1072 | #define SQL_CVT_DECIMAL 0x00000004L 1073 | #define SQL_CVT_INTEGER 0x00000008L 1074 | #define SQL_CVT_SMALLINT 0x00000010L 1075 | #define SQL_CVT_FLOAT 0x00000020L 1076 | #define SQL_CVT_REAL 0x00000040L 1077 | #define SQL_CVT_DOUBLE 0x00000080L 1078 | #define SQL_CVT_VARCHAR 0x00000100L 1079 | #define SQL_CVT_LONGVARCHAR 0x00000200L 1080 | #define SQL_CVT_BINARY 0x00000400L 1081 | #define SQL_CVT_VARBINARY 0x00000800L 1082 | #define SQL_CVT_BIT 0x00001000L 1083 | #define SQL_CVT_TINYINT 0x00002000L 1084 | #define SQL_CVT_BIGINT 0x00004000L 1085 | #define SQL_CVT_DATE 0x00008000L 1086 | #define SQL_CVT_TIME 0x00010000L 1087 | #define SQL_CVT_TIMESTAMP 0x00020000L 1088 | #define SQL_CVT_LONGVARBINARY 0x00040000L 1089 | #if (ODBCVER >= 0x0300) 1090 | #define SQL_CVT_INTERVAL_YEAR_MONTH 0x00080000L 1091 | #define SQL_CVT_INTERVAL_DAY_TIME 0x00100000L 1092 | #define SQL_CVT_WCHAR 0x00200000L 1093 | #define SQL_CVT_WLONGVARCHAR 0x00400000L 1094 | #define SQL_CVT_WVARCHAR 0x00800000L 1095 | #define SQL_CVT_GUID 0x01000000L 1096 | 1097 | #endif /* ODBCVER >= 0x0300 */ 1098 | 1099 | 1100 | /* SQL_CONVERT_FUNCTIONS functions */ 1101 | #define SQL_FN_CVT_CONVERT 0x00000001L 1102 | #if (ODBCVER >= 0x0300) 1103 | #define SQL_FN_CVT_CAST 0x00000002L 1104 | #endif /* ODBCVER >= 0x0300 */ 1105 | 1106 | 1107 | /* SQL_STRING_FUNCTIONS functions */ 1108 | 1109 | #define SQL_FN_STR_CONCAT 0x00000001L 1110 | #define SQL_FN_STR_INSERT 0x00000002L 1111 | #define SQL_FN_STR_LEFT 0x00000004L 1112 | #define SQL_FN_STR_LTRIM 0x00000008L 1113 | #define SQL_FN_STR_LENGTH 0x00000010L 1114 | #define SQL_FN_STR_LOCATE 0x00000020L 1115 | #define SQL_FN_STR_LCASE 0x00000040L 1116 | #define SQL_FN_STR_REPEAT 0x00000080L 1117 | #define SQL_FN_STR_REPLACE 0x00000100L 1118 | #define SQL_FN_STR_RIGHT 0x00000200L 1119 | #define SQL_FN_STR_RTRIM 0x00000400L 1120 | #define SQL_FN_STR_SUBSTRING 0x00000800L 1121 | #define SQL_FN_STR_UCASE 0x00001000L 1122 | #define SQL_FN_STR_ASCII 0x00002000L 1123 | #define SQL_FN_STR_CHAR 0x00004000L 1124 | #define SQL_FN_STR_DIFFERENCE 0x00008000L 1125 | #define SQL_FN_STR_LOCATE_2 0x00010000L 1126 | #define SQL_FN_STR_SOUNDEX 0x00020000L 1127 | #define SQL_FN_STR_SPACE 0x00040000L 1128 | #if (ODBCVER >= 0x0300) 1129 | #define SQL_FN_STR_BIT_LENGTH 0x00080000L 1130 | #define SQL_FN_STR_CHAR_LENGTH 0x00100000L 1131 | #define SQL_FN_STR_CHARACTER_LENGTH 0x00200000L 1132 | #define SQL_FN_STR_OCTET_LENGTH 0x00400000L 1133 | #define SQL_FN_STR_POSITION 0x00800000L 1134 | #endif /* ODBCVER >= 0x0300 */ 1135 | 1136 | /* SQL_SQL92_STRING_FUNCTIONS */ 1137 | #if (ODBCVER >= 0x0300) 1138 | #define SQL_SSF_CONVERT 0x00000001L 1139 | #define SQL_SSF_LOWER 0x00000002L 1140 | #define SQL_SSF_UPPER 0x00000004L 1141 | #define SQL_SSF_SUBSTRING 0x00000008L 1142 | #define SQL_SSF_TRANSLATE 0x00000010L 1143 | #define SQL_SSF_TRIM_BOTH 0x00000020L 1144 | #define SQL_SSF_TRIM_LEADING 0x00000040L 1145 | #define SQL_SSF_TRIM_TRAILING 0x00000080L 1146 | #endif /* ODBCVER >= 0x0300 */ 1147 | #if (ODBCVER >= 0x0400) 1148 | #define SQL_SSF_OVERLAY 0x00000100L 1149 | #define SQL_SSF_LENGTH 0x00000200L 1150 | #define SQL_SSF_POSITION 0x00000400L 1151 | #define SQL_SSF_CONCAT 0x00000800L 1152 | #endif /* ODBCVER >= 0x0400 */ 1153 | 1154 | /* SQL_BINARY_FUNCTIONS functions */ 1155 | #if (ODBCVER >= 0x0400) 1156 | #define SQL_FN_BIN_BIT_LENGTH SQL_FN_STR_BIT_LENGTH 1157 | #define SQL_FN_BIN_CONCAT SQL_FN_STR_CONCAT 1158 | #define SQL_FN_BIN_INSERT SQL_FN_STR_INSERT 1159 | #define SQL_FN_BIN_LTRIM SQL_FN_STR_LTRIM 1160 | #define SQL_FN_BIN_OCTET_LENGTH SQL_FN_STR_OCTET_LENGTH 1161 | #define SQL_FN_BIN_POSITION SQL_FN_STR_POSITION 1162 | #define SQL_FN_BIN_RTRIM SQL_FN_STR_RTRIM 1163 | #define SQL_FN_BIN_SUBSTRING SQL_FN_STR_SUBSTRING 1164 | #endif /* ODBCVER >= 0x0400 */ 1165 | 1166 | /* SQL_SQLBINARY_FUNCTIONS */ 1167 | #if (ODBCVER >= 0x0400) 1168 | #define SQL_SBF_CONVERT SQL_SSF_CONVERT 1169 | #define SQL_SBF_SUBSTRING SQL_SSF_SUBSTRING 1170 | #define SQL_SBF_TRIM_BOTH SQL_SSF_TRIM_BOTH 1171 | #define SQL_SBF_TRIM_LEADING SQL_SSF_TRIM_LEADING 1172 | #define SQL_SBF_TRIM_TRAILING SQL_SSF_TRIM_TRAILING 1173 | #define SQL_SBF_OVERLAY SQL_SSF_OVERLAY 1174 | #define SQL_SBF_LENGTH SQL_SSF_LENGTH 1175 | #define SQL_SBF_POSITION SQL_SSF_POSITION 1176 | #define SQL_SBF_CONCAT SQL_SSF_CONCAT 1177 | #endif /* ODBCVER >= 0x0400 */ 1178 | 1179 | /* SQL_NUMERIC_FUNCTIONS functions */ 1180 | 1181 | #define SQL_FN_NUM_ABS 0x00000001L 1182 | #define SQL_FN_NUM_ACOS 0x00000002L 1183 | #define SQL_FN_NUM_ASIN 0x00000004L 1184 | #define SQL_FN_NUM_ATAN 0x00000008L 1185 | #define SQL_FN_NUM_ATAN2 0x00000010L 1186 | #define SQL_FN_NUM_CEILING 0x00000020L 1187 | #define SQL_FN_NUM_COS 0x00000040L 1188 | #define SQL_FN_NUM_COT 0x00000080L 1189 | #define SQL_FN_NUM_EXP 0x00000100L 1190 | #define SQL_FN_NUM_FLOOR 0x00000200L 1191 | #define SQL_FN_NUM_LOG 0x00000400L 1192 | #define SQL_FN_NUM_MOD 0x00000800L 1193 | #define SQL_FN_NUM_SIGN 0x00001000L 1194 | #define SQL_FN_NUM_SIN 0x00002000L 1195 | #define SQL_FN_NUM_SQRT 0x00004000L 1196 | #define SQL_FN_NUM_TAN 0x00008000L 1197 | #define SQL_FN_NUM_PI 0x00010000L 1198 | #define SQL_FN_NUM_RAND 0x00020000L 1199 | #define SQL_FN_NUM_DEGREES 0x00040000L 1200 | #define SQL_FN_NUM_LOG10 0x00080000L 1201 | #define SQL_FN_NUM_POWER 0x00100000L 1202 | #define SQL_FN_NUM_RADIANS 0x00200000L 1203 | #define SQL_FN_NUM_ROUND 0x00400000L 1204 | #define SQL_FN_NUM_TRUNCATE 0x00800000L 1205 | 1206 | /* SQL_SQL92_NUMERIC_VALUE_FUNCTIONS */ 1207 | #if (ODBCVER >= 0x0300) 1208 | #define SQL_SNVF_BIT_LENGTH 0x00000001L 1209 | #define SQL_SNVF_CHAR_LENGTH 0x00000002L 1210 | #define SQL_SNVF_CHARACTER_LENGTH 0x00000004L 1211 | #define SQL_SNVF_EXTRACT 0x00000008L 1212 | #define SQL_SNVF_OCTET_LENGTH 0x00000010L 1213 | #define SQL_SNVF_POSITION 0x00000020L 1214 | #endif /* ODBCVER >= 0x0300 */ 1215 | 1216 | /* SQL_TIMEDATE_FUNCTIONS functions */ 1217 | 1218 | #define SQL_FN_TD_NOW 0x00000001L 1219 | #define SQL_FN_TD_CURDATE 0x00000002L 1220 | #define SQL_FN_TD_DAYOFMONTH 0x00000004L 1221 | #define SQL_FN_TD_DAYOFWEEK 0x00000008L 1222 | #define SQL_FN_TD_DAYOFYEAR 0x00000010L 1223 | #define SQL_FN_TD_MONTH 0x00000020L 1224 | #define SQL_FN_TD_QUARTER 0x00000040L 1225 | #define SQL_FN_TD_WEEK 0x00000080L 1226 | #define SQL_FN_TD_YEAR 0x00000100L 1227 | #define SQL_FN_TD_CURTIME 0x00000200L 1228 | #define SQL_FN_TD_HOUR 0x00000400L 1229 | #define SQL_FN_TD_MINUTE 0x00000800L 1230 | #define SQL_FN_TD_SECOND 0x00001000L 1231 | #define SQL_FN_TD_TIMESTAMPADD 0x00002000L 1232 | #define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L 1233 | #define SQL_FN_TD_DAYNAME 0x00008000L 1234 | #define SQL_FN_TD_MONTHNAME 0x00010000L 1235 | #if (ODBCVER >= 0x0300) 1236 | #define SQL_FN_TD_CURRENT_DATE 0x00020000L 1237 | #define SQL_FN_TD_CURRENT_TIME 0x00040000L 1238 | #define SQL_FN_TD_CURRENT_TIMESTAMP 0x00080000L 1239 | #define SQL_FN_TD_EXTRACT 0x00100000L 1240 | #endif /* ODBCVER >= 0x0300 */ 1241 | 1242 | /* SQL_SQL92_DATETIME_FUNCTIONS */ 1243 | #if (ODBCVER >= 0x0300) 1244 | #define SQL_SDF_CURRENT_DATE 0x00000001L 1245 | #define SQL_SDF_CURRENT_TIME 0x00000002L 1246 | #define SQL_SDF_CURRENT_TIMESTAMP 0x00000004L 1247 | #endif /* ODBCVER >= 0x0300 */ 1248 | 1249 | /* SQL_SYSTEM_FUNCTIONS functions */ 1250 | 1251 | #define SQL_FN_SYS_USERNAME 0x00000001L 1252 | #define SQL_FN_SYS_DBNAME 0x00000002L 1253 | #define SQL_FN_SYS_IFNULL 0x00000004L 1254 | 1255 | /* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */ 1256 | 1257 | #define SQL_FN_TSI_FRAC_SECOND 0x00000001L 1258 | #define SQL_FN_TSI_SECOND 0x00000002L 1259 | #define SQL_FN_TSI_MINUTE 0x00000004L 1260 | #define SQL_FN_TSI_HOUR 0x00000008L 1261 | #define SQL_FN_TSI_DAY 0x00000010L 1262 | #define SQL_FN_TSI_WEEK 0x00000020L 1263 | #define SQL_FN_TSI_MONTH 0x00000040L 1264 | #define SQL_FN_TSI_QUARTER 0x00000080L 1265 | #define SQL_FN_TSI_YEAR 0x00000100L 1266 | 1267 | /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES1, 1268 | * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1, 1269 | * SQL_KEYSET_CURSOR_ATTRIBUTES1, and SQL_STATIC_CURSOR_ATTRIBUTES1 1270 | */ 1271 | #if (ODBCVER >= 0x0300) 1272 | /* supported SQLFetchScroll FetchOrientation's */ 1273 | #define SQL_CA1_NEXT 0x00000001L 1274 | #define SQL_CA1_ABSOLUTE 0x00000002L 1275 | #define SQL_CA1_RELATIVE 0x00000004L 1276 | #define SQL_CA1_BOOKMARK 0x00000008L 1277 | 1278 | /* supported SQLSetPos LockType's */ 1279 | #define SQL_CA1_LOCK_NO_CHANGE 0x00000040L 1280 | #define SQL_CA1_LOCK_EXCLUSIVE 0x00000080L 1281 | #define SQL_CA1_LOCK_UNLOCK 0x00000100L 1282 | 1283 | /* supported SQLSetPos Operations */ 1284 | #define SQL_CA1_POS_POSITION 0x00000200L 1285 | #define SQL_CA1_POS_UPDATE 0x00000400L 1286 | #define SQL_CA1_POS_DELETE 0x00000800L 1287 | #define SQL_CA1_POS_REFRESH 0x00001000L 1288 | 1289 | /* positioned updates and deletes */ 1290 | #define SQL_CA1_POSITIONED_UPDATE 0x00002000L 1291 | #define SQL_CA1_POSITIONED_DELETE 0x00004000L 1292 | #define SQL_CA1_SELECT_FOR_UPDATE 0x00008000L 1293 | 1294 | /* supported SQLBulkOperations operations */ 1295 | #define SQL_CA1_BULK_ADD 0x00010000L 1296 | #define SQL_CA1_BULK_UPDATE_BY_BOOKMARK 0x00020000L 1297 | #define SQL_CA1_BULK_DELETE_BY_BOOKMARK 0x00040000L 1298 | #define SQL_CA1_BULK_FETCH_BY_BOOKMARK 0x00080000L 1299 | #endif /* ODBCVER >= 0x0300 */ 1300 | 1301 | /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES2, 1302 | * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2, 1303 | * SQL_KEYSET_CURSOR_ATTRIBUTES2, and SQL_STATIC_CURSOR_ATTRIBUTES2 1304 | */ 1305 | #if (ODBCVER >= 0x0300) 1306 | /* supported values for SQL_ATTR_SCROLL_CONCURRENCY */ 1307 | #define SQL_CA2_READ_ONLY_CONCURRENCY 0x00000001L 1308 | #define SQL_CA2_LOCK_CONCURRENCY 0x00000002L 1309 | #define SQL_CA2_OPT_ROWVER_CONCURRENCY 0x00000004L 1310 | #define SQL_CA2_OPT_VALUES_CONCURRENCY 0x00000008L 1311 | 1312 | /* sensitivity of the cursor to its own inserts, deletes, and updates */ 1313 | #define SQL_CA2_SENSITIVITY_ADDITIONS 0x00000010L 1314 | #define SQL_CA2_SENSITIVITY_DELETIONS 0x00000020L 1315 | #define SQL_CA2_SENSITIVITY_UPDATES 0x00000040L 1316 | 1317 | /* semantics of SQL_ATTR_MAX_ROWS */ 1318 | #define SQL_CA2_MAX_ROWS_SELECT 0x00000080L 1319 | #define SQL_CA2_MAX_ROWS_INSERT 0x00000100L 1320 | #define SQL_CA2_MAX_ROWS_DELETE 0x00000200L 1321 | #define SQL_CA2_MAX_ROWS_UPDATE 0x00000400L 1322 | #define SQL_CA2_MAX_ROWS_CATALOG 0x00000800L 1323 | #define SQL_CA2_MAX_ROWS_AFFECTS_ALL (SQL_CA2_MAX_ROWS_SELECT | \ 1324 | SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE | \ 1325 | SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG) 1326 | 1327 | /* semantics of SQL_DIAG_CURSOR_ROW_COUNT */ 1328 | #define SQL_CA2_CRC_EXACT 0x00001000L 1329 | #define SQL_CA2_CRC_APPROXIMATE 0x00002000L 1330 | 1331 | /* the kinds of positioned statements that can be simulated */ 1332 | #define SQL_CA2_SIMULATE_NON_UNIQUE 0x00004000L 1333 | #define SQL_CA2_SIMULATE_TRY_UNIQUE 0x00008000L 1334 | #define SQL_CA2_SIMULATE_UNIQUE 0x00010000L 1335 | #endif /* ODBCVER >= 0x0300 */ 1336 | 1337 | /* SQL_ODBC_API_CONFORMANCE values */ 1338 | 1339 | #define SQL_OAC_NONE 0x0000 1340 | #define SQL_OAC_LEVEL1 0x0001 1341 | #define SQL_OAC_LEVEL2 0x0002 1342 | 1343 | /* SQL_ODBC_SAG_CLI_CONFORMANCE values */ 1344 | 1345 | #define SQL_OSCC_NOT_COMPLIANT 0x0000 1346 | #define SQL_OSCC_COMPLIANT 0x0001 1347 | 1348 | /* SQL_ODBC_SQL_CONFORMANCE values */ 1349 | 1350 | #define SQL_OSC_MINIMUM 0x0000 1351 | #define SQL_OSC_CORE 0x0001 1352 | #define SQL_OSC_EXTENDED 0x0002 1353 | 1354 | 1355 | /* SQL_CONCAT_NULL_BEHAVIOR values */ 1356 | 1357 | #define SQL_CB_NULL 0x0000 1358 | #define SQL_CB_NON_NULL 0x0001 1359 | 1360 | /* SQL_SCROLL_OPTIONS masks */ 1361 | 1362 | #define SQL_SO_FORWARD_ONLY 0x00000001L 1363 | #define SQL_SO_KEYSET_DRIVEN 0x00000002L 1364 | #define SQL_SO_DYNAMIC 0x00000004L 1365 | #define SQL_SO_MIXED 0x00000008L 1366 | #define SQL_SO_STATIC 0x00000010L 1367 | 1368 | /* SQL_FETCH_DIRECTION masks */ 1369 | 1370 | /* SQL_FETCH_RESUME is no longer supported 1371 | #define SQL_FD_FETCH_RESUME 0x00000040L 1372 | */ 1373 | #define SQL_FD_FETCH_BOOKMARK 0x00000080L 1374 | 1375 | /* SQL_TXN_ISOLATION_OPTION masks */ 1376 | /* SQL_TXN_VERSIONING is no longer supported 1377 | #define SQL_TXN_VERSIONING 0x00000010L 1378 | */ 1379 | 1380 | /* SQL_CORRELATION_NAME values */ 1381 | 1382 | #define SQL_CN_NONE 0x0000 1383 | #define SQL_CN_DIFFERENT 0x0001 1384 | #define SQL_CN_ANY 0x0002 1385 | 1386 | /* SQL_NON_NULLABLE_COLUMNS values */ 1387 | 1388 | #define SQL_NNC_NULL 0x0000 1389 | #define SQL_NNC_NON_NULL 0x0001 1390 | 1391 | /* SQL_NULL_COLLATION values */ 1392 | 1393 | #define SQL_NC_START 0x0002 1394 | #define SQL_NC_END 0x0004 1395 | 1396 | /* SQL_FILE_USAGE values */ 1397 | 1398 | #define SQL_FILE_NOT_SUPPORTED 0x0000 1399 | #define SQL_FILE_TABLE 0x0001 1400 | #define SQL_FILE_QUALIFIER 0x0002 1401 | #define SQL_FILE_CATALOG SQL_FILE_QUALIFIER // ODBC 3.0 1402 | 1403 | 1404 | /* SQL_GETDATA_EXTENSIONS values */ 1405 | 1406 | #define SQL_GD_BLOCK 0x00000004L 1407 | #define SQL_GD_BOUND 0x00000008L 1408 | #if (ODBCVER >= 0x0380) 1409 | #define SQL_GD_OUTPUT_PARAMS 0x00000010L 1410 | #endif 1411 | #if (ODBCVER >= 0x0400) 1412 | #define SQL_GD_CONCURRENT 0x00000020L 1413 | #endif /* ODBCVER >= 0x0400 */ 1414 | 1415 | /* SQL_POSITIONED_STATEMENTS masks */ 1416 | 1417 | #define SQL_PS_POSITIONED_DELETE 0x00000001L 1418 | #define SQL_PS_POSITIONED_UPDATE 0x00000002L 1419 | #define SQL_PS_SELECT_FOR_UPDATE 0x00000004L 1420 | 1421 | /* SQL_GROUP_BY values */ 1422 | 1423 | #define SQL_GB_NOT_SUPPORTED 0x0000 1424 | #define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001 1425 | #define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002 1426 | #define SQL_GB_NO_RELATION 0x0003 1427 | #if (ODBCVER >= 0x0300) 1428 | #define SQL_GB_COLLATE 0x0004 1429 | 1430 | #endif /* ODBCVER >= 0x0300 */ 1431 | 1432 | /* SQL_OWNER_USAGE masks */ 1433 | 1434 | #define SQL_OU_DML_STATEMENTS 0x00000001L 1435 | #define SQL_OU_PROCEDURE_INVOCATION 0x00000002L 1436 | #define SQL_OU_TABLE_DEFINITION 0x00000004L 1437 | #define SQL_OU_INDEX_DEFINITION 0x00000008L 1438 | #define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L 1439 | 1440 | /* SQL_SCHEMA_USAGE masks */ 1441 | #if (ODBCVER >= 0x0300) 1442 | #define SQL_SU_DML_STATEMENTS SQL_OU_DML_STATEMENTS 1443 | #define SQL_SU_PROCEDURE_INVOCATION SQL_OU_PROCEDURE_INVOCATION 1444 | #define SQL_SU_TABLE_DEFINITION SQL_OU_TABLE_DEFINITION 1445 | #define SQL_SU_INDEX_DEFINITION SQL_OU_INDEX_DEFINITION 1446 | #define SQL_SU_PRIVILEGE_DEFINITION SQL_OU_PRIVILEGE_DEFINITION 1447 | #endif /* ODBCVER >= 0x0300 */ 1448 | 1449 | /* SQL_QUALIFIER_USAGE masks */ 1450 | 1451 | #define SQL_QU_DML_STATEMENTS 0x00000001L 1452 | #define SQL_QU_PROCEDURE_INVOCATION 0x00000002L 1453 | #define SQL_QU_TABLE_DEFINITION 0x00000004L 1454 | #define SQL_QU_INDEX_DEFINITION 0x00000008L 1455 | #define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L 1456 | 1457 | #if (ODBCVER >= 0x0300) 1458 | /* SQL_CATALOG_USAGE masks */ 1459 | #define SQL_CU_DML_STATEMENTS SQL_QU_DML_STATEMENTS 1460 | #define SQL_CU_PROCEDURE_INVOCATION SQL_QU_PROCEDURE_INVOCATION 1461 | #define SQL_CU_TABLE_DEFINITION SQL_QU_TABLE_DEFINITION 1462 | #define SQL_CU_INDEX_DEFINITION SQL_QU_INDEX_DEFINITION 1463 | #define SQL_CU_PRIVILEGE_DEFINITION SQL_QU_PRIVILEGE_DEFINITION 1464 | #endif /* ODBCVER >= 0x0300 */ 1465 | 1466 | /* SQL_SUBQUERIES masks */ 1467 | 1468 | #define SQL_SQ_COMPARISON 0x00000001L 1469 | #define SQL_SQ_EXISTS 0x00000002L 1470 | #define SQL_SQ_IN 0x00000004L 1471 | #define SQL_SQ_QUANTIFIED 0x00000008L 1472 | #define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L 1473 | 1474 | /* SQL_UNION masks */ 1475 | 1476 | #define SQL_U_UNION 0x00000001L 1477 | #define SQL_U_UNION_ALL 0x00000002L 1478 | 1479 | /* SQL_BOOKMARK_PERSISTENCE values */ 1480 | 1481 | #define SQL_BP_CLOSE 0x00000001L 1482 | #define SQL_BP_DELETE 0x00000002L 1483 | #define SQL_BP_DROP 0x00000004L 1484 | #define SQL_BP_TRANSACTION 0x00000008L 1485 | #define SQL_BP_UPDATE 0x00000010L 1486 | #define SQL_BP_OTHER_HSTMT 0x00000020L 1487 | #define SQL_BP_SCROLL 0x00000040L 1488 | 1489 | /* SQL_STATIC_SENSITIVITY values */ 1490 | 1491 | #define SQL_SS_ADDITIONS 0x00000001L 1492 | #define SQL_SS_DELETIONS 0x00000002L 1493 | #define SQL_SS_UPDATES 0x00000004L 1494 | 1495 | /* SQL_VIEW values */ 1496 | #define SQL_CV_CREATE_VIEW 0x00000001L 1497 | #define SQL_CV_CHECK_OPTION 0x00000002L 1498 | #define SQL_CV_CASCADED 0x00000004L 1499 | #define SQL_CV_LOCAL 0x00000008L 1500 | 1501 | /* SQL_LOCK_TYPES masks */ 1502 | 1503 | #define SQL_LCK_NO_CHANGE 0x00000001L 1504 | #define SQL_LCK_EXCLUSIVE 0x00000002L 1505 | #define SQL_LCK_UNLOCK 0x00000004L 1506 | 1507 | /* SQL_POS_OPERATIONS masks */ 1508 | 1509 | #define SQL_POS_POSITION 0x00000001L 1510 | #define SQL_POS_REFRESH 0x00000002L 1511 | #define SQL_POS_UPDATE 0x00000004L 1512 | #define SQL_POS_DELETE 0x00000008L 1513 | #define SQL_POS_ADD 0x00000010L 1514 | 1515 | /* SQL_QUALIFIER_LOCATION values */ 1516 | 1517 | #define SQL_QL_START 0x0001 1518 | #define SQL_QL_END 0x0002 1519 | 1520 | /* Here start return values for ODBC 3.0 SQLGetInfo */ 1521 | 1522 | #if (ODBCVER >= 0x0300) 1523 | /* SQL_AGGREGATE_FUNCTIONS bitmasks */ 1524 | #define SQL_AF_AVG 0x00000001L 1525 | #define SQL_AF_COUNT 0x00000002L 1526 | #define SQL_AF_MAX 0x00000004L 1527 | #define SQL_AF_MIN 0x00000008L 1528 | #define SQL_AF_SUM 0x00000010L 1529 | #define SQL_AF_DISTINCT 0x00000020L 1530 | #define SQL_AF_ALL 0x00000040L 1531 | #if (ODBCVER >= 0x0400) 1532 | #define SQL_AF_EVERY 0x00000080L 1533 | #define SQL_AF_ANY 0x00000100L 1534 | #define SQL_AF_STDEV_OP 0x00000200L 1535 | #define SQL_AF_STDEV_SAMP 0x00000400L 1536 | #define SQL_AF_VAR_SAMP 0x00000800L 1537 | #define SQL_AF_VAR_POP 0x00001000L 1538 | #define SQL_AF_ARRAY_AGG 0x00002000L 1539 | #define SQL_AF_COLLECT 0x00004000L 1540 | #define SQL_AF_FUSION 0x00008000L 1541 | #define SQL_AF_INTERSECTION 0x00010000L 1542 | #endif /* ODBCVER >= 0x0400 */ 1543 | 1544 | /* SQL_SQL_CONFORMANCE bit masks */ 1545 | #define SQL_SC_SQL92_ENTRY 0x00000001L 1546 | #define SQL_SC_FIPS127_2_TRANSITIONAL 0x00000002L 1547 | #define SQL_SC_SQL92_INTERMEDIATE 0x00000004L 1548 | #define SQL_SC_SQL92_FULL 0x00000008L 1549 | 1550 | /* SQL_DATETIME_LITERALS masks */ 1551 | #define SQL_DL_SQL92_DATE 0x00000001L 1552 | #define SQL_DL_SQL92_TIME 0x00000002L 1553 | #define SQL_DL_SQL92_TIMESTAMP 0x00000004L 1554 | #define SQL_DL_SQL92_INTERVAL_YEAR 0x00000008L 1555 | #define SQL_DL_SQL92_INTERVAL_MONTH 0x00000010L 1556 | #define SQL_DL_SQL92_INTERVAL_DAY 0x00000020L 1557 | #define SQL_DL_SQL92_INTERVAL_HOUR 0x00000040L 1558 | #define SQL_DL_SQL92_INTERVAL_MINUTE 0x00000080L 1559 | #define SQL_DL_SQL92_INTERVAL_SECOND 0x00000100L 1560 | #define SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH 0x00000200L 1561 | #define SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR 0x00000400L 1562 | #define SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE 0x00000800L 1563 | #define SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND 0x00001000L 1564 | #define SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE 0x00002000L 1565 | #define SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND 0x00004000L 1566 | #define SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND 0x00008000L 1567 | 1568 | /* SQL_CATALOG_LOCATION values */ 1569 | #define SQL_CL_START SQL_QL_START 1570 | #define SQL_CL_END SQL_QL_END 1571 | 1572 | /* values for SQL_BATCH_ROW_COUNT */ 1573 | #define SQL_BRC_PROCEDURES 0x0000001 1574 | #define SQL_BRC_EXPLICIT 0x0000002 1575 | #define SQL_BRC_ROLLED_UP 0x0000004 1576 | 1577 | /* bitmasks for SQL_BATCH_SUPPORT */ 1578 | #define SQL_BS_SELECT_EXPLICIT 0x00000001L 1579 | #define SQL_BS_ROW_COUNT_EXPLICIT 0x00000002L 1580 | #define SQL_BS_SELECT_PROC 0x00000004L 1581 | #define SQL_BS_ROW_COUNT_PROC 0x00000008L 1582 | 1583 | /* Values for SQL_PARAM_ARRAY_ROW_COUNTS getinfo */ 1584 | #define SQL_PARC_BATCH 1 1585 | #define SQL_PARC_NO_BATCH 2 1586 | 1587 | /* values for SQL_PARAM_ARRAY_SELECTS */ 1588 | #define SQL_PAS_BATCH 1 1589 | #define SQL_PAS_NO_BATCH 2 1590 | #define SQL_PAS_NO_SELECT 3 1591 | 1592 | /* Bitmasks for SQL_INDEX_KEYWORDS */ 1593 | #define SQL_IK_NONE 0x00000000L 1594 | #define SQL_IK_ASC 0x00000001L 1595 | #define SQL_IK_DESC 0x00000002L 1596 | #define SQL_IK_ALL (SQL_IK_ASC | SQL_IK_DESC) 1597 | 1598 | /* Bitmasks for SQL_INFO_SCHEMA_VIEWS */ 1599 | 1600 | #define SQL_ISV_ASSERTIONS 0x00000001L 1601 | #define SQL_ISV_CHARACTER_SETS 0x00000002L 1602 | #define SQL_ISV_CHECK_CONSTRAINTS 0x00000004L 1603 | #define SQL_ISV_COLLATIONS 0x00000008L 1604 | #define SQL_ISV_COLUMN_DOMAIN_USAGE 0x00000010L 1605 | #define SQL_ISV_COLUMN_PRIVILEGES 0x00000020L 1606 | #define SQL_ISV_COLUMNS 0x00000040L 1607 | #define SQL_ISV_CONSTRAINT_COLUMN_USAGE 0x00000080L 1608 | #define SQL_ISV_CONSTRAINT_TABLE_USAGE 0x00000100L 1609 | #define SQL_ISV_DOMAIN_CONSTRAINTS 0x00000200L 1610 | #define SQL_ISV_DOMAINS 0x00000400L 1611 | #define SQL_ISV_KEY_COLUMN_USAGE 0x00000800L 1612 | #define SQL_ISV_REFERENTIAL_CONSTRAINTS 0x00001000L 1613 | #define SQL_ISV_SCHEMATA 0x00002000L 1614 | #define SQL_ISV_SQL_LANGUAGES 0x00004000L 1615 | #define SQL_ISV_TABLE_CONSTRAINTS 0x00008000L 1616 | #define SQL_ISV_TABLE_PRIVILEGES 0x00010000L 1617 | #define SQL_ISV_TABLES 0x00020000L 1618 | #define SQL_ISV_TRANSLATIONS 0x00040000L 1619 | #define SQL_ISV_USAGE_PRIVILEGES 0x00080000L 1620 | #define SQL_ISV_VIEW_COLUMN_USAGE 0x00100000L 1621 | #define SQL_ISV_VIEW_TABLE_USAGE 0x00200000L 1622 | #define SQL_ISV_VIEWS 0x00400000L 1623 | 1624 | /* Bitmasks for SQL_ASYNC_MODE */ 1625 | 1626 | #define SQL_AM_NONE 0 1627 | #define SQL_AM_CONNECTION 1 1628 | #define SQL_AM_STATEMENT 2 1629 | 1630 | /* Bitmasks for SQL_ALTER_DOMAIN */ 1631 | #define SQL_AD_CONSTRAINT_NAME_DEFINITION 0x00000001L 1632 | #define SQL_AD_ADD_DOMAIN_CONSTRAINT 0x00000002L 1633 | #define SQL_AD_DROP_DOMAIN_CONSTRAINT 0x00000004L 1634 | #define SQL_AD_ADD_DOMAIN_DEFAULT 0x00000008L 1635 | #define SQL_AD_DROP_DOMAIN_DEFAULT 0x00000010L 1636 | #define SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L 1637 | #define SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L 1638 | #define SQL_AD_ADD_CONSTRAINT_DEFERRABLE 0x00000080L 1639 | #define SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE 0x00000100L 1640 | 1641 | 1642 | /* SQL_CREATE_SCHEMA bitmasks */ 1643 | #define SQL_CS_CREATE_SCHEMA 0x00000001L 1644 | #define SQL_CS_AUTHORIZATION 0x00000002L 1645 | #define SQL_CS_DEFAULT_CHARACTER_SET 0x00000004L 1646 | 1647 | /* SQL_CREATE_TRANSLATION bitmasks */ 1648 | #define SQL_CTR_CREATE_TRANSLATION 0x00000001L 1649 | 1650 | /* SQL_CREATE_ASSERTION bitmasks */ 1651 | #define SQL_CA_CREATE_ASSERTION 0x00000001L 1652 | #define SQL_CA_CONSTRAINT_INITIALLY_DEFERRED 0x00000010L 1653 | #define SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000020L 1654 | #define SQL_CA_CONSTRAINT_DEFERRABLE 0x00000040L 1655 | #define SQL_CA_CONSTRAINT_NON_DEFERRABLE 0x00000080L 1656 | 1657 | /* SQL_CREATE_CHARACTER_SET bitmasks */ 1658 | #define SQL_CCS_CREATE_CHARACTER_SET 0x00000001L 1659 | #define SQL_CCS_COLLATE_CLAUSE 0x00000002L 1660 | #define SQL_CCS_LIMITED_COLLATION 0x00000004L 1661 | 1662 | /* SQL_CREATE_COLLATION bitmasks */ 1663 | #define SQL_CCOL_CREATE_COLLATION 0x00000001L 1664 | 1665 | /* SQL_CREATE_DOMAIN bitmasks */ 1666 | #define SQL_CDO_CREATE_DOMAIN 0x00000001L 1667 | #define SQL_CDO_DEFAULT 0x00000002L 1668 | #define SQL_CDO_CONSTRAINT 0x00000004L 1669 | #define SQL_CDO_COLLATION 0x00000008L 1670 | #define SQL_CDO_CONSTRAINT_NAME_DEFINITION 0x00000010L 1671 | #define SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L 1672 | #define SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L 1673 | #define SQL_CDO_CONSTRAINT_DEFERRABLE 0x00000080L 1674 | #define SQL_CDO_CONSTRAINT_NON_DEFERRABLE 0x00000100L 1675 | 1676 | /* SQL_CREATE_TABLE bitmasks */ 1677 | #define SQL_CT_CREATE_TABLE 0x00000001L 1678 | #define SQL_CT_COMMIT_PRESERVE 0x00000002L 1679 | #define SQL_CT_COMMIT_DELETE 0x00000004L 1680 | #define SQL_CT_GLOBAL_TEMPORARY 0x00000008L 1681 | #define SQL_CT_LOCAL_TEMPORARY 0x00000010L 1682 | #define SQL_CT_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L 1683 | #define SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L 1684 | #define SQL_CT_CONSTRAINT_DEFERRABLE 0x00000080L 1685 | #define SQL_CT_CONSTRAINT_NON_DEFERRABLE 0x00000100L 1686 | #define SQL_CT_COLUMN_CONSTRAINT 0x00000200L 1687 | #define SQL_CT_COLUMN_DEFAULT 0x00000400L 1688 | #define SQL_CT_COLUMN_COLLATION 0x00000800L 1689 | #define SQL_CT_TABLE_CONSTRAINT 0x00001000L 1690 | #define SQL_CT_CONSTRAINT_NAME_DEFINITION 0x00002000L 1691 | 1692 | /* SQL_DDL_INDEX bitmasks */ 1693 | #define SQL_DI_CREATE_INDEX 0x00000001L 1694 | #define SQL_DI_DROP_INDEX 0x00000002L 1695 | 1696 | /* SQL_DROP_COLLATION bitmasks */ 1697 | #define SQL_DC_DROP_COLLATION 0x00000001L 1698 | 1699 | /* SQL_DROP_DOMAIN bitmasks */ 1700 | #define SQL_DD_DROP_DOMAIN 0x00000001L 1701 | #define SQL_DD_RESTRICT 0x00000002L 1702 | #define SQL_DD_CASCADE 0x00000004L 1703 | 1704 | /* SQL_DROP_SCHEMA bitmasks */ 1705 | #define SQL_DS_DROP_SCHEMA 0x00000001L 1706 | #define SQL_DS_RESTRICT 0x00000002L 1707 | #define SQL_DS_CASCADE 0x00000004L 1708 | 1709 | /* SQL_DROP_CHARACTER_SET bitmasks */ 1710 | #define SQL_DCS_DROP_CHARACTER_SET 0x00000001L 1711 | 1712 | /* SQL_DROP_ASSERTION bitmasks */ 1713 | #define SQL_DA_DROP_ASSERTION 0x00000001L 1714 | 1715 | /* SQL_DROP_TABLE bitmasks */ 1716 | #define SQL_DT_DROP_TABLE 0x00000001L 1717 | #define SQL_DT_RESTRICT 0x00000002L 1718 | #define SQL_DT_CASCADE 0x00000004L 1719 | 1720 | /* SQL_DROP_TRANSLATION bitmasks */ 1721 | #define SQL_DTR_DROP_TRANSLATION 0x00000001L 1722 | 1723 | /* SQL_DROP_VIEW bitmasks */ 1724 | #define SQL_DV_DROP_VIEW 0x00000001L 1725 | #define SQL_DV_RESTRICT 0x00000002L 1726 | #define SQL_DV_CASCADE 0x00000004L 1727 | 1728 | /* SQL_INSERT_STATEMENT bitmasks */ 1729 | #define SQL_IS_INSERT_LITERALS 0x00000001L 1730 | #define SQL_IS_INSERT_SEARCHED 0x00000002L 1731 | #define SQL_IS_SELECT_INTO 0x00000004L 1732 | 1733 | /* SQL_ODBC_INTERFACE_CONFORMANCE values */ 1734 | #define SQL_OIC_CORE 1UL 1735 | #define SQL_OIC_LEVEL1 2UL 1736 | #define SQL_OIC_LEVEL2 3UL 1737 | 1738 | /* SQL_SQL92_FOREIGN_KEY_DELETE_RULE bitmasks */ 1739 | #define SQL_SFKD_CASCADE 0x00000001L 1740 | #define SQL_SFKD_NO_ACTION 0x00000002L 1741 | #define SQL_SFKD_SET_DEFAULT 0x00000004L 1742 | #define SQL_SFKD_SET_NULL 0x00000008L 1743 | 1744 | /* SQL_SQL92_FOREIGN_KEY_UPDATE_RULE bitmasks */ 1745 | #define SQL_SFKU_CASCADE 0x00000001L 1746 | #define SQL_SFKU_NO_ACTION 0x00000002L 1747 | #define SQL_SFKU_SET_DEFAULT 0x00000004L 1748 | #define SQL_SFKU_SET_NULL 0x00000008L 1749 | 1750 | /* SQL_SQL92_GRANT bitmasks */ 1751 | #define SQL_SG_USAGE_ON_DOMAIN 0x00000001L 1752 | #define SQL_SG_USAGE_ON_CHARACTER_SET 0x00000002L 1753 | #define SQL_SG_USAGE_ON_COLLATION 0x00000004L 1754 | #define SQL_SG_USAGE_ON_TRANSLATION 0x00000008L 1755 | #define SQL_SG_WITH_GRANT_OPTION 0x00000010L 1756 | #define SQL_SG_DELETE_TABLE 0x00000020L 1757 | #define SQL_SG_INSERT_TABLE 0x00000040L 1758 | #define SQL_SG_INSERT_COLUMN 0x00000080L 1759 | #define SQL_SG_REFERENCES_TABLE 0x00000100L 1760 | #define SQL_SG_REFERENCES_COLUMN 0x00000200L 1761 | #define SQL_SG_SELECT_TABLE 0x00000400L 1762 | #define SQL_SG_UPDATE_TABLE 0x00000800L 1763 | #define SQL_SG_UPDATE_COLUMN 0x00001000L 1764 | 1765 | /* SQL_SQL92_PREDICATES bitmasks */ 1766 | #define SQL_SP_EXISTS 0x00000001L 1767 | #define SQL_SP_ISNOTNULL 0x00000002L 1768 | #define SQL_SP_ISNULL 0x00000004L 1769 | #define SQL_SP_MATCH_FULL 0x00000008L 1770 | #define SQL_SP_MATCH_PARTIAL 0x00000010L 1771 | #define SQL_SP_MATCH_UNIQUE_FULL 0x00000020L 1772 | #define SQL_SP_MATCH_UNIQUE_PARTIAL 0x00000040L 1773 | #define SQL_SP_OVERLAPS 0x00000080L 1774 | #define SQL_SP_UNIQUE 0x00000100L 1775 | #define SQL_SP_LIKE 0x00000200L 1776 | #define SQL_SP_IN 0x00000400L 1777 | #define SQL_SP_BETWEEN 0x00000800L 1778 | #define SQL_SP_COMPARISON 0x00001000L 1779 | #define SQL_SP_QUANTIFIED_COMPARISON 0x00002000L 1780 | 1781 | /* SQL_SQL92_RELATIONAL_JOIN_OPERATORS bitmasks */ 1782 | #define SQL_SRJO_CORRESPONDING_CLAUSE 0x00000001L 1783 | #define SQL_SRJO_CROSS_JOIN 0x00000002L 1784 | #define SQL_SRJO_EXCEPT_JOIN 0x00000004L 1785 | #define SQL_SRJO_FULL_OUTER_JOIN 0x00000008L 1786 | #define SQL_SRJO_INNER_JOIN 0x00000010L 1787 | #define SQL_SRJO_INTERSECT_JOIN 0x00000020L 1788 | #define SQL_SRJO_LEFT_OUTER_JOIN 0x00000040L 1789 | #define SQL_SRJO_NATURAL_JOIN 0x00000080L 1790 | #define SQL_SRJO_RIGHT_OUTER_JOIN 0x00000100L 1791 | #define SQL_SRJO_UNION_JOIN 0x00000200L 1792 | 1793 | /* SQL_SQL92_REVOKE bitmasks */ 1794 | #define SQL_SR_USAGE_ON_DOMAIN 0x00000001L 1795 | #define SQL_SR_USAGE_ON_CHARACTER_SET 0x00000002L 1796 | #define SQL_SR_USAGE_ON_COLLATION 0x00000004L 1797 | #define SQL_SR_USAGE_ON_TRANSLATION 0x00000008L 1798 | #define SQL_SR_GRANT_OPTION_FOR 0x00000010L 1799 | #define SQL_SR_CASCADE 0x00000020L 1800 | #define SQL_SR_RESTRICT 0x00000040L 1801 | #define SQL_SR_DELETE_TABLE 0x00000080L 1802 | #define SQL_SR_INSERT_TABLE 0x00000100L 1803 | #define SQL_SR_INSERT_COLUMN 0x00000200L 1804 | #define SQL_SR_REFERENCES_TABLE 0x00000400L 1805 | #define SQL_SR_REFERENCES_COLUMN 0x00000800L 1806 | #define SQL_SR_SELECT_TABLE 0x00001000L 1807 | #define SQL_SR_UPDATE_TABLE 0x00002000L 1808 | #define SQL_SR_UPDATE_COLUMN 0x00004000L 1809 | 1810 | /* SQL_SQL92_ROW_VALUE_CONSTRUCTOR bitmasks */ 1811 | #define SQL_SRVC_VALUE_EXPRESSION 0x00000001L 1812 | #define SQL_SRVC_NULL 0x00000002L 1813 | #define SQL_SRVC_DEFAULT 0x00000004L 1814 | #define SQL_SRVC_ROW_SUBQUERY 0x00000008L 1815 | 1816 | /* SQL_SQL92_VALUE_EXPRESSIONS bitmasks */ 1817 | #define SQL_SVE_CASE 0x00000001L 1818 | #define SQL_SVE_CAST 0x00000002L 1819 | #define SQL_SVE_COALESCE 0x00000004L 1820 | #define SQL_SVE_NULLIF 0x00000008L 1821 | 1822 | /* SQL_STANDARD_CLI_CONFORMANCE bitmasks */ 1823 | #define SQL_SCC_XOPEN_CLI_VERSION1 0x00000001L 1824 | #define SQL_SCC_ISO92_CLI 0x00000002L 1825 | 1826 | /* SQL_UNION_STATEMENT bitmasks */ 1827 | #define SQL_US_UNION SQL_U_UNION 1828 | #define SQL_US_UNION_ALL SQL_U_UNION_ALL 1829 | 1830 | /* values for SQL_DRIVER_AWARE_POOLING_SUPPORTED */ 1831 | #define SQL_DRIVER_AWARE_POOLING_NOT_CAPABLE 0x00000000L 1832 | #define SQL_DRIVER_AWARE_POOLING_CAPABLE 0x00000001L 1833 | #endif /* ODBCVER >= 0x0300 */ 1834 | 1835 | /* SQL_DTC_TRANSITION_COST bitmasks */ 1836 | #define SQL_DTC_ENLIST_EXPENSIVE 0x00000001L 1837 | #define SQL_DTC_UNENLIST_EXPENSIVE 0x00000002L 1838 | 1839 | #if (ODBCVER >= 0x0380) 1840 | // possible values for SQL_ASYNC_DBC_FUNCTIONS 1841 | #define SQL_ASYNC_DBC_NOT_CAPABLE 0x00000000L 1842 | #define SQL_ASYNC_DBC_CAPABLE 0x00000001L 1843 | #endif // ODBCVER >= 0x0380 1844 | 1845 | /* Bitmask values for SQL_LIMIT_ESCAPE_CLAUSE */ 1846 | #if (ODBCVER >= 0x0400) 1847 | #define SQL_LC_NONE 0x00000000L 1848 | #define SQL_LC_TAKE 0x00000001L 1849 | #define SQL_LC_SKIP 0x00000003L 1850 | #endif /* ODBCVER >= 0x0400 */ 1851 | 1852 | /* Bitmask values for SQL_RETURN_ESCAPE_CLAUSE */ 1853 | #if (ODBCVER >= 0x0400) 1854 | #define SQL_RC_NONE 0x00000000L 1855 | #define SQL_RC_INSERT_SINGLE_ROWID 0x00000001L 1856 | #define SQL_RC_INSERT_SINGLE_ANY ( 0x00000002L | SQL_RC_INSERT_SINGLE_ROWID ) 1857 | #define SQL_RC_INSERT_MULTIPLE_ROWID ( 0x00000004L | SQL_RC_INSERT_SINGLE_ROWID) 1858 | #define SQL_RC_INSERT_MULTIPLE_ANY ( 0x00000008L | SQL_RC_INSERT_MULTIPLE_ROWID | SQL_RC_INSERT_SINGLE_ANY ) 1859 | #define SQL_RC_INSERT_SELECT_ROWID 0x00000010L 1860 | #define SQL_RC_INSERT_SELECT_ANY ( 0x00000020L | SQL_RC_INSERT_SELECT_ROWID ) 1861 | #define SQL_RC_UPDATE_ROWID 0x00000040L 1862 | #define SQL_RC_UPDATE_ANY ( 0x00000080L | SQL_RC_UPDATE_ROWID) 1863 | #define SQL_RC_DELETE_ROWID 0x00000100L 1864 | #define SQL_RC_DELETE_ANY ( 0x00000200L | SQL_RC_DELETE_ROWID ) 1865 | #define SQL_RC_SELECT_INTO_ROWID 0x00000400L 1866 | #define SQL_RC_SELECT_INTO_ANY ( 0x00000800L | SQL_RC_SELECT_INTO_ROWID ) 1867 | #endif /* ODBCVER >= 0x0400 */ 1868 | 1869 | /* Bitmask values for SQL_FORMAT_ESCAPE_CLAUSE */ 1870 | #if (ODBCVER >= 0x0400) 1871 | #define SQL_FC_NONE 0x00000000L 1872 | #define SQL_FC_JSON 0x00000001L 1873 | #define SQL_FC_JSON_BINARY 0x00000002L 1874 | #endif /* ODBCVER >= 0x0400 */ 1875 | 1876 | /* additional SQLDataSources fetch directions */ 1877 | #if (ODBCVER >= 0x0300) 1878 | #define SQL_FETCH_FIRST_USER 31 1879 | #define SQL_FETCH_FIRST_SYSTEM 32 1880 | #endif /* ODBCVER >= 0x0300 */ 1881 | 1882 | 1883 | /* Defines for SQLSetPos */ 1884 | #define SQL_ENTIRE_ROWSET 0 1885 | 1886 | /* Operations in SQLSetPos */ 1887 | #define SQL_POSITION 0 /* 1.0 FALSE */ 1888 | #define SQL_REFRESH 1 /* 1.0 TRUE */ 1889 | #define SQL_UPDATE 2 1890 | #define SQL_DELETE 3 1891 | 1892 | /* Operations in SQLBulkOperations */ 1893 | #define SQL_ADD 4 1894 | #define SQL_SETPOS_MAX_OPTION_VALUE SQL_ADD 1895 | #if (ODBCVER >= 0x0300) 1896 | #define SQL_UPDATE_BY_BOOKMARK 5 1897 | #define SQL_DELETE_BY_BOOKMARK 6 1898 | #define SQL_FETCH_BY_BOOKMARK 7 1899 | 1900 | #endif /* ODBCVER >= 0x0300 */ 1901 | 1902 | /* Lock options in SQLSetPos */ 1903 | #define SQL_LOCK_NO_CHANGE 0 /* 1.0 FALSE */ 1904 | #define SQL_LOCK_EXCLUSIVE 1 /* 1.0 TRUE */ 1905 | #define SQL_LOCK_UNLOCK 2 1906 | 1907 | #define SQL_SETPOS_MAX_LOCK_VALUE SQL_LOCK_UNLOCK 1908 | 1909 | /* Macros for SQLSetPos */ 1910 | #define SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE) 1911 | #define SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock) 1912 | #define SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock) 1913 | #define SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE) 1914 | #define SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE) 1915 | #define SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE) 1916 | 1917 | /* Column types and scopes in SQLSpecialColumns. */ 1918 | #define SQL_BEST_ROWID 1 1919 | #define SQL_ROWVER 2 1920 | 1921 | /* Defines for SQLSpecialColumns (returned in the result set) 1922 | SQL_PC_UNKNOWN and SQL_PC_PSEUDO are defined in sql.h */ 1923 | #define SQL_PC_NOT_PSEUDO 1 1924 | 1925 | /* Defines for SQLStatistics */ 1926 | #define SQL_QUICK 0 1927 | #define SQL_ENSURE 1 1928 | 1929 | /* Defines for SQLStatistics (returned in the result set) 1930 | SQL_INDEX_CLUSTERED, SQL_INDEX_HASHED, and SQL_INDEX_OTHER are 1931 | defined in sql.h */ 1932 | #define SQL_TABLE_STAT 0 1933 | 1934 | 1935 | /* Defines for SQLTables */ 1936 | #if (ODBCVER >= 0x0300) 1937 | #define SQL_ALL_CATALOGS "%" 1938 | #define SQL_ALL_SCHEMAS "%" 1939 | #define SQL_ALL_TABLE_TYPES "%" 1940 | #endif /* ODBCVER >= 0x0300 */ 1941 | 1942 | /* Options for SQLDriverConnect */ 1943 | #define SQL_DRIVER_NOPROMPT 0 1944 | #define SQL_DRIVER_COMPLETE 1 1945 | #define SQL_DRIVER_PROMPT 2 1946 | #define SQL_DRIVER_COMPLETE_REQUIRED 3 1947 | 1948 | #ifndef RC_INVOKED 1949 | 1950 | SQLRETURN SQL_API SQLDriverConnect( 1951 | SQLHDBC hdbc, 1952 | SQLHWND hwnd, 1953 | _In_reads_(cchConnStrIn) 1954 | SQLCHAR *szConnStrIn, 1955 | SQLSMALLINT cchConnStrIn, 1956 | _Out_writes_opt_(cchConnStrOutMax) 1957 | SQLCHAR *szConnStrOut, 1958 | SQLSMALLINT cchConnStrOutMax, 1959 | _Out_opt_ 1960 | SQLSMALLINT *pcchConnStrOut, 1961 | SQLUSMALLINT fDriverCompletion); 1962 | 1963 | #endif /* RC_INVOKED */ 1964 | 1965 | /* Level 2 Functions */ 1966 | 1967 | /* SQLExtendedFetch "fFetchType" values */ 1968 | #define SQL_FETCH_BOOKMARK 8 1969 | 1970 | /* SQLExtendedFetch "rgfRowStatus" element values */ 1971 | #define SQL_ROW_SUCCESS 0 1972 | #define SQL_ROW_DELETED 1 1973 | #define SQL_ROW_UPDATED 2 1974 | #define SQL_ROW_NOROW 3 1975 | #define SQL_ROW_ADDED 4 1976 | #define SQL_ROW_ERROR 5 1977 | #if (ODBCVER >= 0x0300) 1978 | #define SQL_ROW_SUCCESS_WITH_INFO 6 1979 | #define SQL_ROW_PROCEED 0 1980 | #define SQL_ROW_IGNORE 1 1981 | #endif 1982 | 1983 | /* value for SQL_DESC_ARRAY_STATUS_PTR */ 1984 | #if (ODBCVER >= 0x0300) 1985 | #define SQL_PARAM_SUCCESS 0 1986 | #define SQL_PARAM_SUCCESS_WITH_INFO 6 1987 | #define SQL_PARAM_ERROR 5 1988 | #define SQL_PARAM_UNUSED 7 1989 | #define SQL_PARAM_DIAG_UNAVAILABLE 1 1990 | 1991 | #define SQL_PARAM_PROCEED 0 1992 | #define SQL_PARAM_IGNORE 1 1993 | #endif /* ODBCVER >= 0x0300 */ 1994 | 1995 | /* Defines for SQLForeignKeys (UPDATE_RULE and DELETE_RULE) */ 1996 | #define SQL_CASCADE 0 1997 | #define SQL_RESTRICT 1 1998 | #define SQL_SET_NULL 2 1999 | #if (ODBCVER >= 0x0250) 2000 | #define SQL_NO_ACTION 3 2001 | #define SQL_SET_DEFAULT 4 2002 | #endif /* ODBCVER >= 0x0250 */ 2003 | 2004 | #if (ODBCVER >= 0x0300) 2005 | /* Note that the following are in a different column of SQLForeignKeys than */ 2006 | /* the previous #defines. These are for DEFERRABILITY. */ 2007 | 2008 | #define SQL_INITIALLY_DEFERRED 5 2009 | #define SQL_INITIALLY_IMMEDIATE 6 2010 | #define SQL_NOT_DEFERRABLE 7 2011 | 2012 | #endif /* ODBCVER >= 0x0300 */ 2013 | 2014 | /* Defines for SQLBindParameter and 2015 | SQLProcedureColumns (returned in the result set) */ 2016 | #define SQL_PARAM_TYPE_UNKNOWN 0 2017 | #define SQL_PARAM_INPUT 1 2018 | #define SQL_PARAM_INPUT_OUTPUT 2 2019 | #define SQL_RESULT_COL 3 2020 | #define SQL_PARAM_OUTPUT 4 2021 | #define SQL_RETURN_VALUE 5 2022 | #if (ODBCVER >= 0x0380) 2023 | #define SQL_PARAM_INPUT_OUTPUT_STREAM 8 2024 | #define SQL_PARAM_OUTPUT_STREAM 16 2025 | #endif 2026 | 2027 | /* Defines for SQLProcedures (returned in the result set) */ 2028 | #define SQL_PT_UNKNOWN 0 2029 | #define SQL_PT_PROCEDURE 1 2030 | #define SQL_PT_FUNCTION 2 2031 | 2032 | #ifndef RC_INVOKED 2033 | 2034 | /* This define is too large for RC */ 2035 | #define SQL_ODBC_KEYWORDS \ 2036 | "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ 2037 | "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ 2038 | "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ 2039 | "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ 2040 | "COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\ 2041 | "CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\ 2042 | "CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\ 2043 | "DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\ 2044 | "DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\ 2045 | "DISTINCT,DOMAIN,DOUBLE,DROP,"\ 2046 | "ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\ 2047 | "EXISTS,EXTERNAL,EXTRACT,"\ 2048 | "FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\ 2049 | "GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\ 2050 | "IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\ 2051 | "INPUT,INSENSITIVE,INSERT,INT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\ 2052 | "JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\ 2053 | "MATCH,MAX,MIN,MINUTE,MODULE,MONTH,"\ 2054 | "NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\ 2055 | "OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\ 2056 | "PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\ 2057 | "PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\ 2058 | "READ,REAL,REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS"\ 2059 | "SCHEMA,SCROLL,SECOND,SECTION,SELECT,SESSION,SESSION_USER,SET,SIZE,"\ 2060 | "SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\ 2061 | "SUBSTRING,SUM,SYSTEM_USER,"\ 2062 | "TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\ 2063 | "TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\ 2064 | "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ 2065 | "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\ 2066 | "YEAR,ZONE" 2067 | 2068 | SQLRETURN SQL_API SQLBrowseConnect( 2069 | SQLHDBC hdbc, 2070 | _In_reads_(cchConnStrIn) 2071 | SQLCHAR *szConnStrIn, 2072 | SQLSMALLINT cchConnStrIn, 2073 | _Out_writes_opt_(cchConnStrOutMax) 2074 | SQLCHAR *szConnStrOut, 2075 | SQLSMALLINT cchConnStrOutMax, 2076 | _Out_opt_ 2077 | SQLSMALLINT *pcchConnStrOut); 2078 | 2079 | #if (ODBCVER >= 0x0300) 2080 | SQLRETURN SQL_API SQLBulkOperations( 2081 | SQLHSTMT StatementHandle, 2082 | SQLSMALLINT Operation); 2083 | #endif /* ODBCVER >= 0x0300 */ 2084 | 2085 | SQLRETURN SQL_API SQLColAttributes( 2086 | SQLHSTMT hstmt, 2087 | SQLUSMALLINT icol, 2088 | SQLUSMALLINT fDescType, 2089 | SQLPOINTER rgbDesc, 2090 | SQLSMALLINT cbDescMax, 2091 | SQLSMALLINT *pcbDesc, 2092 | SQLLEN * pfDesc); 2093 | 2094 | SQLRETURN SQL_API SQLColumnPrivileges( 2095 | SQLHSTMT hstmt, 2096 | _In_reads_opt_(cchCatalogName) 2097 | SQLCHAR *szCatalogName, 2098 | SQLSMALLINT cchCatalogName, 2099 | _In_reads_opt_(cchSchemaName) 2100 | SQLCHAR *szSchemaName, 2101 | SQLSMALLINT cchSchemaName, 2102 | _In_reads_opt_(cchTableName) 2103 | SQLCHAR *szTableName, 2104 | SQLSMALLINT cchTableName, 2105 | _In_reads_opt_(cchColumnName) 2106 | SQLCHAR *szColumnName, 2107 | SQLSMALLINT cchColumnName); 2108 | 2109 | SQLRETURN SQL_API SQLDescribeParam( 2110 | SQLHSTMT hstmt, 2111 | SQLUSMALLINT ipar, 2112 | _Out_opt_ 2113 | SQLSMALLINT *pfSqlType, 2114 | _Out_opt_ 2115 | SQLULEN *pcbParamDef, 2116 | _Out_opt_ 2117 | SQLSMALLINT *pibScale, 2118 | _Out_opt_ 2119 | SQLSMALLINT *pfNullable); 2120 | 2121 | SQLRETURN SQL_API SQLExtendedFetch( 2122 | SQLHSTMT hstmt, 2123 | SQLUSMALLINT fFetchType, 2124 | SQLLEN irow, 2125 | _Out_opt_ 2126 | SQLULEN *pcrow, 2127 | _Out_opt_ 2128 | SQLUSMALLINT *rgfRowStatus); 2129 | 2130 | SQLRETURN SQL_API SQLForeignKeys( 2131 | SQLHSTMT hstmt, 2132 | _In_reads_opt_(cchPkCatalogName) 2133 | SQLCHAR *szPkCatalogName, 2134 | SQLSMALLINT cchPkCatalogName, 2135 | _In_reads_opt_(cchPkSchemaName) 2136 | SQLCHAR *szPkSchemaName, 2137 | SQLSMALLINT cchPkSchemaName, 2138 | _In_reads_opt_(cchPkTableName) 2139 | SQLCHAR *szPkTableName, 2140 | SQLSMALLINT cchPkTableName, 2141 | _In_reads_opt_(cchFkCatalogName) 2142 | SQLCHAR *szFkCatalogName, 2143 | SQLSMALLINT cchFkCatalogName, 2144 | _In_reads_opt_(cchFkSchemaName) 2145 | SQLCHAR *szFkSchemaName, 2146 | SQLSMALLINT cchFkSchemaName, 2147 | _In_reads_opt_(cchFkTableName) 2148 | SQLCHAR *szFkTableName, 2149 | SQLSMALLINT cchFkTableName); 2150 | 2151 | SQLRETURN SQL_API SQLMoreResults( 2152 | SQLHSTMT hstmt); 2153 | 2154 | SQLRETURN SQL_API SQLNativeSql 2155 | ( 2156 | SQLHDBC hdbc, 2157 | _In_reads_(cchSqlStrIn) SQLCHAR* szSqlStrIn, 2158 | SQLINTEGER cchSqlStrIn, 2159 | _Out_writes_opt_(cchSqlStrMax) SQLCHAR* szSqlStr, 2160 | SQLINTEGER cchSqlStrMax, 2161 | SQLINTEGER *pcbSqlStr 2162 | ); 2163 | 2164 | SQLRETURN SQL_API SQLNumParams( 2165 | SQLHSTMT hstmt, 2166 | _Out_opt_ 2167 | SQLSMALLINT *pcpar); 2168 | 2169 | SQLRETURN SQL_API SQLParamOptions( 2170 | SQLHSTMT hstmt, 2171 | SQLULEN crow, 2172 | SQLULEN *pirow); 2173 | 2174 | SQLRETURN SQL_API SQLPrimaryKeys( 2175 | SQLHSTMT hstmt, 2176 | _In_reads_opt_(cchCatalogName) 2177 | SQLCHAR *szCatalogName, 2178 | SQLSMALLINT cchCatalogName, 2179 | _In_reads_opt_(cchSchemaName) 2180 | SQLCHAR *szSchemaName, 2181 | SQLSMALLINT cchSchemaName, 2182 | _In_reads_opt_(cchTableName) 2183 | SQLCHAR *szTableName, 2184 | SQLSMALLINT cchTableName); 2185 | 2186 | SQLRETURN SQL_API SQLProcedureColumns( 2187 | SQLHSTMT hstmt, 2188 | _In_reads_opt_(cchCatalogName) 2189 | SQLCHAR *szCatalogName, 2190 | SQLSMALLINT cchCatalogName, 2191 | _In_reads_opt_(cchSchemaName) 2192 | SQLCHAR *szSchemaName, 2193 | SQLSMALLINT cchSchemaName, 2194 | _In_reads_opt_(cchProcName) 2195 | SQLCHAR *szProcName, 2196 | SQLSMALLINT cchProcName, 2197 | _In_reads_opt_(cchColumnName) 2198 | SQLCHAR *szColumnName, 2199 | SQLSMALLINT cchColumnName); 2200 | 2201 | SQLRETURN SQL_API SQLProcedures( 2202 | SQLHSTMT hstmt, 2203 | _In_reads_opt_(cchCatalogName) 2204 | SQLCHAR *szCatalogName, 2205 | SQLSMALLINT cchCatalogName, 2206 | _In_reads_opt_(cchSchemaName) 2207 | SQLCHAR *szSchemaName, 2208 | SQLSMALLINT cchSchemaName, 2209 | _In_reads_opt_(cchProcName) 2210 | SQLCHAR *szProcName, 2211 | SQLSMALLINT cchProcName); 2212 | 2213 | 2214 | 2215 | SQLRETURN SQL_API SQLSetPos( 2216 | SQLHSTMT hstmt, 2217 | SQLSETPOSIROW irow, 2218 | SQLUSMALLINT fOption, 2219 | SQLUSMALLINT fLock); 2220 | 2221 | SQLRETURN SQL_API SQLTablePrivileges( 2222 | SQLHSTMT hstmt, 2223 | _In_reads_opt_(cchCatalogName) 2224 | SQLCHAR *szCatalogName, 2225 | SQLSMALLINT cchCatalogName, 2226 | _In_reads_opt_(cchSchemaName) 2227 | SQLCHAR *szSchemaName, 2228 | SQLSMALLINT cchSchemaName, 2229 | _In_reads_opt_(cchTableName) 2230 | SQLCHAR *szTableName, 2231 | SQLSMALLINT cchTableName); 2232 | 2233 | SQLRETURN SQL_API SQLDrivers( 2234 | SQLHENV henv, 2235 | SQLUSMALLINT fDirection, 2236 | _Out_writes_opt_(cchDriverDescMax) 2237 | SQLCHAR *szDriverDesc, 2238 | SQLSMALLINT cchDriverDescMax, 2239 | _Out_opt_ 2240 | SQLSMALLINT *pcchDriverDesc, 2241 | _Out_writes_opt_(cchDrvrAttrMax) 2242 | SQLCHAR *szDriverAttributes, 2243 | SQLSMALLINT cchDrvrAttrMax, 2244 | _Out_opt_ 2245 | SQLSMALLINT *pcchDrvrAttr); 2246 | 2247 | SQLRETURN SQL_API SQLBindParameter( 2248 | SQLHSTMT hstmt, 2249 | SQLUSMALLINT ipar, 2250 | SQLSMALLINT fParamType, 2251 | SQLSMALLINT fCType, 2252 | SQLSMALLINT fSqlType, 2253 | SQLULEN cbColDef, 2254 | SQLSMALLINT ibScale, 2255 | SQLPOINTER rgbValue, 2256 | SQLLEN cbValueMax, 2257 | SQLLEN *pcbValue); 2258 | 2259 | #if (ODBCVER >= 0x0400) 2260 | SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, 2261 | SQLHANDLE InputHandle, _Out_ SQLHANDLE *OutputHandle); 2262 | 2263 | SQLRETURN SQL_API SQLGetNestedHandle( 2264 | SQLHSTMT ParentStatementHandle, 2265 | SQLUSMALLINT Col_or_Param_Num, 2266 | _Out_ SQLHSTMT* OutputChildStatementHandle); 2267 | 2268 | SQLRETURN SQL_API SQLStructuredTypes( 2269 | SQLHSTMT StatementHandle, 2270 | _In_reads_opt_(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, 2271 | _In_reads_opt_(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, 2272 | _In_reads_opt_(NameLength3) SQLCHAR *TypeName, SQLSMALLINT NameLength3); 2273 | 2274 | SQLRETURN SQL_API SQLStructuredTypeColumns( 2275 | SQLHSTMT StatementHandle, 2276 | _In_reads_opt_(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, 2277 | _In_reads_opt_(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, 2278 | _In_reads_opt_(NameLength3) SQLCHAR *TypeName, SQLSMALLINT NameLength3, 2279 | _In_reads_opt_(NameLength4) SQLCHAR *ColumnName, SQLSMALLINT NameLength4); 2280 | 2281 | SQLRETURN SQL_API SQLNextColumn(SQLHSTMT StatementHandle, 2282 | _Out_ SQLUSMALLINT *ColumnCount); 2283 | #endif /* ODBCVER >= 0x0400 */ 2284 | 2285 | #endif /* RC_INVOKED */ 2286 | 2287 | /*---------------------------------------------------------*/ 2288 | /* SQLAllocHandleStd is implemented to make SQLAllocHandle */ 2289 | /* compatible with X/Open standard. an application should */ 2290 | /* not call SQLAllocHandleStd directly */ 2291 | /*---------------------------------------------------------*/ 2292 | #ifdef ODBC_STD 2293 | #define SQLAllocHandle SQLAllocHandleStd 2294 | #define SQLAllocEnv(phenv) SQLAllocHandleStd(SQL_HANDLE_ENV, SQL_NULL_HANDLE, phenv) 2295 | 2296 | /* Internal type subcodes */ 2297 | #define SQL_YEAR SQL_CODE_YEAR 2298 | #define SQL_MONTH SQL_CODE_MONTH 2299 | #define SQL_DAY SQL_CODE_DAY 2300 | #define SQL_HOUR SQL_CODE_HOUR 2301 | #define SQL_MINUTE SQL_CODE_MINUTE 2302 | #define SQL_SECOND SQL_CODE_SECOND 2303 | #define SQL_YEAR_TO_MONTH SQL_CODE_YEAR_TO_MONTH 2304 | #define SQL_DAY_TO_HOUR SQL_CODE_DAY_TO_HOUR 2305 | #define SQL_DAY_TO_MINUTE SQL_CODE_DAY_TO_MINUTE 2306 | #define SQL_DAY_TO_SECOND SQL_CODE_DAY_TO_SECOND 2307 | #define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE 2308 | #define SQL_HOUR_TO_SECOND SQL_CODE_HOUR_TO_SECOND 2309 | #define SQL_MINUTE_TO_SECOND SQL_CODE_MINUTE_TO_SECOND 2310 | #endif /* ODBC_STD */ 2311 | 2312 | #if (ODBCVER >= 0x0300) 2313 | #ifndef RC_INVOKED 2314 | SQLRETURN SQL_API SQLAllocHandleStd( 2315 | SQLSMALLINT fHandleType, 2316 | SQLHANDLE hInput, 2317 | _Out_ 2318 | SQLHANDLE *phOutput); 2319 | #endif /* RC_INVOKED */ 2320 | #endif 2321 | 2322 | /* Deprecated defines from prior versions of ODBC */ 2323 | #define SQL_DATABASE_NAME 16 /* Use SQLGetConnectOption/SQL_CURRENT_QUALIFIER */ 2324 | #define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR 2325 | #define SQL_FETCH_PREV SQL_FETCH_PRIOR 2326 | #define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER 2327 | #define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER 2328 | #define SQL_CC_DELETE SQL_CB_DELETE 2329 | #define SQL_CR_DELETE SQL_CB_DELETE 2330 | #define SQL_CC_CLOSE SQL_CB_CLOSE 2331 | #define SQL_CR_CLOSE SQL_CB_CLOSE 2332 | #define SQL_CC_PRESERVE SQL_CB_PRESERVE 2333 | #define SQL_CR_PRESERVE SQL_CB_PRESERVE 2334 | /* SQL_FETCH_RESUME is not supported by 2.0+ drivers 2335 | #define SQL_FETCH_RESUME 7 2336 | */ 2337 | #define SQL_SCROLL_FORWARD_ONLY 0L /*-SQL_CURSOR_FORWARD_ONLY */ 2338 | #define SQL_SCROLL_KEYSET_DRIVEN (-1L) /*-SQL_CURSOR_KEYSET_DRIVEN */ 2339 | #define SQL_SCROLL_DYNAMIC (-2L) /*-SQL_CURSOR_DYNAMIC */ 2340 | #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */ 2341 | 2342 | /* Deprecated functions from prior versions of ODBC */ 2343 | #ifndef RC_INVOKED 2344 | 2345 | SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */ 2346 | SQLHSTMT hstmt, 2347 | SQLUSMALLINT fConcurrency, 2348 | SQLLEN crowKeyset, 2349 | SQLUSMALLINT crowRowset); 2350 | 2351 | /* Tracing section */ 2352 | 2353 | #define TRACE_VERSION 1000 /* Version of trace API */ 2354 | 2355 | // open a trace log file 2356 | RETCODE SQL_API TraceOpenLogFile 2357 | ( 2358 | _In_opt_ LPWSTR szFileName, 2359 | _Out_writes_bytes_opt_(cbOutputMsg) LPWSTR lpwszOutputMsg, 2360 | _In_ DWORD cbOutputMsg 2361 | ); 2362 | 2363 | RETCODE SQL_API TraceCloseLogFile(); // Request to close a trace log 2364 | VOID SQL_API TraceReturn(RETCODE,RETCODE); // Processes trace after FN is called 2365 | DWORD SQL_API TraceVersion(); // Returns trace API version 2366 | 2367 | /* Functions for Visual Studio Analyzer*/ 2368 | /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */ 2369 | #pragma deprecated(TRACE_VS_EVENT_ON) 2370 | #define TRACE_ON 0x00000001L 2371 | #define TRACE_VS_EVENT_ON 0x00000002L 2372 | 2373 | RETCODE SQL_API TraceVSControl(DWORD); 2374 | 2375 | /* Functions for setting the connection pooling failure detection code */ 2376 | /* The "TryWait" value is the time (in seconds) that the DM will wait */ 2377 | /* between detecting that a connection is dead (using */ 2378 | /* SQL_ATTR_CONNECTION_DEAD) and retrying the connection. During that */ 2379 | /* interval, connection requests will get "The server appears to be */ 2380 | /* dead" error returns. */ 2381 | 2382 | 2383 | BOOL SQL_API ODBCSetTryWaitValue(DWORD dwValue); /* In seconds */ 2384 | DWORD SQL_API ODBCGetTryWaitValue(); /* In Milliseconds(!) */ 2385 | 2386 | 2387 | //------------- Visual Studio Analyzer Support is removed from ODBC (Windows 8 and onwards) --------- 2388 | // From Windows 8 and onwards, Visual Studio Analyzer Support for ODBC is removed. Third-party trace 2389 | // library does not need to define the function FireVSDebugEvent any more, which would not be called 2390 | // from ODBC DM in Windows 8. 2391 | // If your trace library is going to work on downlevel platforms, you may still want to define the 2392 | // function FireVSDebugEvent. But the trace library can still be loaded on downlevel platforms even 2393 | // if this function is not defined. 2394 | // 2395 | #pragma deprecated(ODBC_VS_FLAG_UNICODE_ARG, ODBC_VS_FLAG_UNICODE_COR, ODBC_VS_FLAG_RETCODE, ODBC_VS_FLAG_STOP, tagODBC_VS_ARGS, ODBC_VS_ARGS, PODBC_VS_ARGS) 2396 | 2397 | // the flags in ODBC_VS_ARGS 2398 | #define ODBC_VS_FLAG_UNICODE_ARG 0x00000001L /* the argument is unicode */ 2399 | #define ODBC_VS_FLAG_UNICODE_COR 0x00000002L /* the correlation is unicode */ 2400 | #define ODBC_VS_FLAG_RETCODE 0x00000004L /* RetCode field is set */ 2401 | #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */ 2402 | 2403 | #pragma warning( push ) 2404 | #pragma warning(disable:4995) 2405 | typedef struct tagODBC_VS_ARGS { 2406 | const GUID *pguidEvent; /* the GUID for event */ 2407 | DWORD dwFlags; /* flags for the call */ 2408 | union { 2409 | WCHAR *wszArg; 2410 | CHAR *szArg; 2411 | }; 2412 | union { 2413 | WCHAR *wszCorrelation; 2414 | CHAR *szCorrelation; 2415 | }; 2416 | RETCODE RetCode; 2417 | } ODBC_VS_ARGS, *PODBC_VS_ARGS; 2418 | 2419 | VOID SQL_API FireVSDebugEvent(PODBC_VS_ARGS); 2420 | #pragma warning( pop ) 2421 | 2422 | #endif /* RC_INVOKED */ 2423 | 2424 | 2425 | #ifdef __cplusplus 2426 | } /* End of extern "C" { */ 2427 | #endif /* __cplusplus */ 2428 | 2429 | #if defined(WIN32) || defined(_WIN64) 2430 | #include "sqlucode.h" 2431 | #endif 2432 | 2433 | 2434 | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ 2435 | #pragma endregion 2436 | 2437 | #endif /* __SQLEXT */ 2438 | --------------------------------------------------------------------------------