1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_ 29 #define _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_ 30 31 #include "odbc/OFunctiondefs.hxx" 32 #include <rtl/ustring.hxx> 33 #include <osl/module.h> 34 35 namespace connectivity 36 { 37 38 // sal_Bool LoadFunctions(oslModule pODBCso, sal_Bool _bDS=sal_True); 39 // sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath); 40 // sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath); 41 42 // Connecting to a data source 43 typedef SQLRETURN (SQL_API *T3SQLAllocHandle) (SQLSMALLINT HandleType,SQLHANDLE InputHandle,SQLHANDLE * OutputHandlePtr); 44 45 #define N3SQLAllocHandle(a,b,c) (*(T3SQLAllocHandle)getOdbcFunction(ODBC3SQLAllocHandle))(a,b,c) 46 47 typedef SQLRETURN (SQL_API *T3SQLConnect) (SQLHDBC ConnectionHandle,SQLCHAR *ServerName,SQLSMALLINT NameLength1,SQLCHAR *UserName,SQLSMALLINT NameLength2,SQLCHAR *Authentication,SQLSMALLINT NameLength3); 48 49 #define N3SQLConnect(a,b,c,d,e,f,g) (*(T3SQLConnect)getOdbcFunction(ODBC3SQLConnect))(a,b,c,d,e,f,g) 50 51 typedef SQLRETURN (SQL_API *T3SQLDriverConnect) ( SQLHDBC ConnectionHandle, 52 HWND WindowHandle, 53 SQLCHAR * InConnectionString, 54 SQLSMALLINT StringLength1, 55 SQLCHAR * OutConnectionString, 56 SQLSMALLINT BufferLength, 57 SQLSMALLINT * StringLength2Ptr, 58 SQLUSMALLINT DriverCompletion); 59 60 #define N3SQLDriverConnect(a,b,c,d,e,f,g,h) (*(T3SQLDriverConnect)getOdbcFunction(ODBC3SQLDriverConnect))(a,b,c,d,e,f,g,h) 61 62 typedef SQLRETURN (SQL_API *T3SQLBrowseConnect) ( SQLHDBC ConnectionHandle, 63 SQLCHAR * InConnectionString, 64 SQLSMALLINT StringLength1, 65 SQLCHAR * OutConnectionString, 66 SQLSMALLINT BufferLength, 67 SQLSMALLINT * StringLength2Ptr); 68 69 #define N3SQLBrowseConnect(a,b,c,d,e,f) (*(T3SQLBrowseConnect)getOdbcFunction(ODBC3SQLBrowseConnect))(a,b,c,d,e,f) 70 71 // Obtaining information about a driver and data source 72 typedef SQLRETURN (SQL_API *T3SQLDataSources) ( SQLHENV EnvironmentHandle, 73 SQLUSMALLINT Direction, 74 SQLCHAR * ServerName, 75 SQLSMALLINT BufferLength1, 76 SQLSMALLINT * NameLength1Ptr, 77 SQLCHAR * Description, 78 SQLSMALLINT BufferLength2, 79 SQLSMALLINT * NameLength2Ptr); 80 81 #define N3SQLDataSources(a,b,c,d,e,f,g,h) (*(T3SQLDataSources)getOdbcFunction(ODBC3SQLDataSources))(a,b,c,d,e,f,g,h) 82 83 typedef SQLRETURN (SQL_API *T3SQLDrivers) ( SQLHENV EnvironmentHandle, 84 SQLUSMALLINT Direction, 85 SQLCHAR * DriverDescription, 86 SQLSMALLINT BufferLength1, 87 SQLSMALLINT * DescriptionLengthPtr, 88 SQLCHAR * DriverAttributes, 89 SQLSMALLINT BufferLength2, 90 SQLSMALLINT * AttributesLengthPtr); 91 92 #define N3SQLDrivers(a,b,c,d,e,f,g,h) (*(T3SQLDrivers)getOdbcFunction(ODBC3SQLDrivers))(a,b,c,d,e,f,g,h) 93 94 typedef SQLRETURN (SQL_API *T3SQLGetInfo) ( SQLHDBC ConnectionHandle, 95 SQLUSMALLINT InfoType, 96 SQLPOINTER InfoValuePtr, 97 SQLSMALLINT BufferLength, 98 SQLSMALLINT * StringLengthPtr); 99 100 #define N3SQLGetInfo(a,b,c,d,e) (*(T3SQLGetInfo)getOdbcFunction(ODBC3SQLGetInfo))(a,b,c,d,e) 101 102 typedef SQLRETURN (SQL_API *T3SQLGetFunctions) (SQLHDBC ConnectionHandle, 103 SQLUSMALLINT FunctionId, 104 SQLUSMALLINT * SupportedPtr); 105 106 #define N3SQLGetFunctions(a,b,c) (*(T3SQLGetFunctions)getOdbcFunction(ODBC3SQLGetFunctions))(a,b,c) 107 108 typedef SQLRETURN (SQL_API *T3SQLGetTypeInfo) ( SQLHSTMT StatementHandle, 109 SQLSMALLINT DataType); 110 111 #define N3SQLGetTypeInfo(a,b) (*(T3SQLGetTypeInfo)getOdbcFunction(ODBC3SQLGetTypeInfo))(a,b) 112 113 // Setting and retrieving driver attributes 114 typedef SQLRETURN (SQL_API *T3SQLSetConnectAttr)(SQLHDBC ConnectionHandle, 115 SQLINTEGER Attribute, 116 SQLPOINTER ValuePtr, 117 SQLINTEGER StringLength); 118 119 #define N3SQLSetConnectAttr(a,b,c,d) (*(T3SQLSetConnectAttr)getOdbcFunction(ODBC3SQLSetConnectAttr))(a,b,c,d) 120 121 typedef SQLRETURN (SQL_API *T3SQLGetConnectAttr) (SQLHDBC ConnectionHandle, 122 SQLINTEGER Attribute, 123 SQLPOINTER ValuePtr, 124 SQLINTEGER BufferLength, 125 SQLINTEGER* StringLength); 126 127 #define N3SQLGetConnectAttr(a,b,c,d,e) (*(T3SQLGetConnectAttr)getOdbcFunction(ODBC3SQLGetConnectAttr))(a,b,c,d,e) 128 129 130 typedef SQLRETURN (SQL_API *T3SQLSetEnvAttr) ( SQLHENV EnvironmentHandle, 131 SQLINTEGER Attribute, 132 SQLPOINTER ValuePtr, 133 SQLINTEGER StringLength); 134 135 #define N3SQLSetEnvAttr(a,b,c,d) (*(T3SQLSetEnvAttr)getOdbcFunction(ODBC3SQLSetEnvAttr))(a,b,c,d) 136 137 typedef SQLRETURN (SQL_API *T3SQLGetEnvAttr) ( SQLHENV EnvironmentHandle, 138 SQLINTEGER Attribute, 139 SQLPOINTER ValuePtr, 140 SQLINTEGER BufferLength, 141 SQLINTEGER* StringLength); 142 143 #define N3SQLGetEnvAttr(a,b,c,d,e) (*(T3SQLGetEnvAttr)getOdbcFunction(ODBC3SQLGetEnvAttr))(a,b,c,d,e) 144 145 146 typedef SQLRETURN (SQL_API *T3SQLSetStmtAttr) ( SQLHSTMT StatementHandle, 147 SQLINTEGER Attribute, 148 SQLPOINTER ValuePtr, 149 SQLINTEGER StringLength); 150 151 #define N3SQLSetStmtAttr(a,b,c,d) (*(T3SQLSetStmtAttr)getOdbcFunction(ODBC3SQLSetStmtAttr))(a,b,c,d) 152 153 typedef SQLRETURN (SQL_API *T3SQLGetStmtAttr) ( SQLHSTMT StatementHandle, 154 SQLINTEGER Attribute, 155 SQLPOINTER ValuePtr, 156 SQLINTEGER BufferLength, 157 SQLINTEGER* StringLength); 158 159 #define N3SQLGetStmtAttr(a,b,c,d,e) (*(T3SQLGetStmtAttr)getOdbcFunction(ODBC3SQLGetStmtAttr))(a,b,c,d,e) 160 161 // Setting and retrieving descriptor fields 162 /*typedef SQLRETURN (SQL_API *T3SQLSetDescField) (SQLHDESC DescriptorHandle, 163 SQLSMALLINT RecNumber, 164 SQLSMALLINT FieldIdentifier, 165 SQLPOINTER ValuePtr, 166 SQLINTEGER BufferLength); 167 168 #define N3SQLSetDescField(a,b,c,d,e) (*(T3SQLSetDescField)getOdbcFunction(ODBC3SQLSetDescField))(a,b,c,d,e) 169 170 typedef SQLRETURN (SQL_API *T3SQLGetDescField) ( SQLHDESC DescriptorHandle, 171 SQLSMALLINT RecNumber, 172 SQLSMALLINT FieldIdentifier, 173 SQLPOINTER ValuePtr, 174 SQLINTEGER BufferLength, 175 SQLINTEGER * StringLengthPtr); 176 177 #define N3SQLGetDescField(a,b,c,d,e,f) (*(T3SQLGetDescField)getOdbcFunction(ODBC3SQLGetDescField))(a,b,c,d,e,f) 178 179 180 typedef SQLRETURN (SQL_API *T3SQLGetDescRec) ( SQLHDESC DescriptorHandle, 181 SQLSMALLINT RecNumber, 182 SQLCHAR * Name, 183 SQLSMALLINT BufferLength, 184 SQLSMALLINT * StringLengthPtr, 185 SQLSMALLINT * TypePtr, 186 SQLSMALLINT * SubTypePtr, 187 SQLLEN * LengthPtr, 188 SQLSMALLINT * PrecisionPtr, 189 SQLSMALLINT * ScalePtr, 190 SQLSMALLINT * NullablePtr); 191 192 #define N3SQLGetDescRec(a,b,c,d,e,f,g,h,i,j,k) (*(T3SQLGetDescRec)getOdbcFunction(ODBC3SQLGetDescRec))(a,b,c,d,e,f,g,h,i,j,k) 193 194 195 typedef SQLRETURN (SQL_API *T3SQLSetDescRec) ( SQLHDESC DescriptorHandle, 196 SQLSMALLINT RecNumber, 197 SQLSMALLINT Type, 198 SQLSMALLINT SubType, 199 SQLINTEGER Length, 200 SQLSMALLINT Precision, 201 SQLSMALLINT Scale, 202 SQLPOINTER DataPtr, 203 SQLLEN * StringLengthPtr, 204 SQLLEN * IndicatorPtr); 205 206 #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j) 207 */ 208 209 // Preparing SQL requests 210 typedef SQLRETURN (SQL_API *T3SQLPrepare) ( SQLHSTMT StatementHandle, 211 SQLCHAR * StatementText, 212 SQLINTEGER TextLength); 213 214 #define N3SQLPrepare(a,b,c) (*(T3SQLPrepare)getOdbcFunction(ODBC3SQLPrepare))(a,b,c) 215 216 typedef SQLRETURN (SQL_API *T3SQLBindParameter) (SQLHSTMT StatementHandle, 217 SQLUSMALLINT ParameterNumber, 218 SQLSMALLINT InputOutputType, 219 SQLSMALLINT ValueType, 220 SQLSMALLINT ParameterType, 221 SQLULEN ColumnSize, 222 SQLSMALLINT DecimalDigits, 223 SQLPOINTER ParameterValuePtr, 224 SQLLEN BufferLength, 225 SQLLEN * StrLen_or_IndPtr); 226 227 #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j) 228 229 /*typedef SQLRETURN (SQL_API *T3SQLGetCursorName) (SQLHSTMT StatementHandle, 230 SQLCHAR * CursorName, 231 SQLSMALLINT BufferLength, 232 SQLSMALLINT * NameLengthPtr); 233 234 #define N3SQLGetCursorName(a,b,c,d) (*(T3SQLGetCursorName)getOdbcFunction(ODBC3SQLGetCursorName))(a,b,c,d) 235 */ 236 237 typedef SQLRETURN (SQL_API *T3SQLSetCursorName) (SQLHSTMT StatementHandle, 238 SQLCHAR * CursorName, 239 SQLSMALLINT NameLength); 240 241 #define N3SQLSetCursorName(a,b,c) (*(T3SQLSetCursorName)getOdbcFunction(ODBC3SQLSetCursorName))(a,b,c) 242 243 // Submitting requests 244 typedef SQLRETURN (SQL_API *T3SQLExecute) ( SQLHSTMT StatementHandle); 245 246 #define N3SQLExecute(a) (*(T3SQLExecute)getOdbcFunction(ODBC3SQLExecute))(a) 247 248 typedef SQLRETURN (SQL_API *T3SQLExecDirect) ( SQLHSTMT StatementHandle, 249 SQLCHAR * StatementText, 250 SQLINTEGER TextLength); 251 252 #define N3SQLExecDirect(a,b,c) (*(T3SQLExecDirect)getOdbcFunction(ODBC3SQLExecDirect))(a,b,c) 253 254 /*typedef SQLRETURN (SQL_API *T3SQLNativeSql) ( SQLHDBC ConnectionHandle, 255 SQLCHAR * InStatementText, 256 SQLINTEGER TextLength1, 257 SQLCHAR * utStatementText, 258 SQLINTEGER BufferLength, 259 SQLINTEGER * TextLength2Ptr); 260 261 #define N3SQLNativeSql(a,b,c,d,e,f) (*(T3SQLNativeSql)getOdbcFunction(ODBC3SQLNativeSql))(a,b,c,d,e,f)*/ 262 263 typedef SQLRETURN (SQL_API *T3SQLDescribeParam) (SQLHSTMT StatementHandle, 264 SQLUSMALLINT ParameterNumber, 265 SQLSMALLINT * DataTypePtr, 266 SQLULEN * ParameterSizePtr, 267 SQLSMALLINT * DecimalDigitsPtr, 268 SQLSMALLINT * NullablePtr); 269 270 #define N3SQLDescribeParam(a,b,c,d,e,f) (*(T3SQLDescribeParam)getOdbcFunction(ODBC3SQLDescribeParam))(a,b,c,d,e,f) 271 272 typedef SQLRETURN (SQL_API *T3SQLNumParams) ( SQLHSTMT StatementHandle, 273 SQLSMALLINT * ParameterCountPtr); 274 275 #define N3SQLNumParams(a,b) (*(T3SQLNumParams)getOdbcFunction(ODBC3SQLNumParams))(a,b) 276 277 typedef SQLRETURN (SQL_API *T3SQLParamData) ( SQLHSTMT StatementHandle, 278 SQLPOINTER * ValuePtrPtr); 279 280 #define N3SQLParamData(a,b) (*(T3SQLParamData)getOdbcFunction(ODBC3SQLParamData))(a,b) 281 282 typedef SQLRETURN (SQL_API *T3SQLPutData) ( SQLHSTMT StatementHandle, 283 SQLPOINTER DataPtr, 284 SQLLEN StrLen_or_Ind); 285 286 #define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c) 287 288 // Retrieving results and information about results 289 typedef SQLRETURN (SQL_API *T3SQLRowCount) ( SQLHSTMT StatementHandle, 290 SQLLEN * RowCountPtr); 291 292 #define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b) 293 294 typedef SQLRETURN (SQL_API *T3SQLNumResultCols) (SQLHSTMT StatementHandle, 295 SQLSMALLINT * ColumnCountPtr); 296 297 #define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b) 298 299 typedef SQLRETURN (SQL_API *T3SQLDescribeCol) ( SQLHSTMT StatementHandle, 300 SQLUSMALLINT ColumnNumber, 301 SQLCHAR * ColumnName, 302 SQLSMALLINT BufferLength, 303 SQLSMALLINT * NameLengthPtr, 304 SQLSMALLINT * DataTypePtr, 305 SQLULEN * ColumnSizePtr, 306 SQLSMALLINT * DecimalDigitsPtr, 307 SQLSMALLINT * NullablePtr); 308 309 #define N3SQLDescribeCol(a,b,c,d,e,f,g,h,i) (*(T3SQLDescribeCol)getOdbcFunction(ODBC3SQLDescribeCol))(a,b,c,d,e,f,g,h,i) 310 311 typedef SQLRETURN (SQL_API *T3SQLColAttribute) (SQLHSTMT StatementHandle, 312 SQLUSMALLINT ColumnNumber, 313 SQLUSMALLINT FieldIdentifier, 314 SQLPOINTER CharacterAttributePtr, 315 SQLSMALLINT BufferLength, 316 SQLSMALLINT * StringLengthPtr, 317 SQLLEN * NumericAttributePtr); 318 319 #define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g) 320 321 typedef SQLRETURN (SQL_API *T3SQLBindCol) ( SQLHSTMT StatementHandle, 322 SQLUSMALLINT ColumnNumber, 323 SQLSMALLINT TargetType, 324 SQLPOINTER TargetValuePtr, 325 SQLLEN BufferLength, 326 SQLLEN * StrLen_or_IndPtr); 327 328 #define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f) 329 330 typedef SQLRETURN (SQL_API *T3SQLFetch) ( SQLHSTMT StatementHandle); 331 332 #define N3SQLFetch(a) (*(T3SQLFetch)getOdbcFunction(ODBC3SQLFetch))(a) 333 334 typedef SQLRETURN (SQL_API *T3SQLFetchScroll) ( SQLHSTMT StatementHandle, 335 SQLSMALLINT FetchOrientation, 336 SQLLEN FetchOffset); 337 338 #define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c) 339 340 typedef SQLRETURN (SQL_API *T3SQLGetData) ( SQLHSTMT StatementHandle, 341 SQLUSMALLINT ColumnNumber, 342 SQLSMALLINT TargetType, 343 SQLPOINTER TargetValuePtr, 344 SQLLEN BufferLength, 345 SQLLEN * StrLen_or_IndPtr); 346 347 #define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f) 348 349 typedef SQLRETURN (SQL_API *T3SQLSetPos) ( SQLHSTMT StatementHandle, 350 SQLSETPOSIROW RowNumber, 351 SQLUSMALLINT Operation, 352 SQLUSMALLINT LockType); 353 354 #define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d) 355 356 typedef SQLRETURN (SQL_API *T3SQLBulkOperations) ( SQLHSTMT StatementHandle, 357 SQLSMALLINT Operation); 358 359 #define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b) 360 361 typedef SQLRETURN (SQL_API *T3SQLMoreResults) ( SQLHSTMT StatementHandle); 362 363 #define N3SQLMoreResults(a) (*(T3SQLMoreResults)getOdbcFunction(ODBC3SQLMoreResults))(a) 364 365 /*typedef SQLRETURN (SQL_API *T3SQLGetDiagField) (SQLSMALLINT HandleType, 366 SQLHANDLE Handle, 367 SQLSMALLINT RecNumber, 368 SQLSMALLINT DiagIdentifier, 369 SQLPOINTER DiagInfoPtr, 370 SQLSMALLINT BufferLength, 371 SQLSMALLINT * StringLengthPtr); 372 373 #define N3SQLGetDiagField(a,b,c,d,e,f,g) (*(T3SQLGetDiagField)getOdbcFunction(ODBC3SQLGetDiagField))(a,b,c,d,e,f,g)*/ 374 375 typedef SQLRETURN (SQL_API *T3SQLGetDiagRec) ( SQLSMALLINT HandleType, 376 SQLHANDLE Handle, 377 SQLSMALLINT RecNumber, 378 SQLCHAR * Sqlstate, 379 SQLINTEGER * NativeErrorPtr, 380 SQLCHAR * MessageText, 381 SQLSMALLINT BufferLength, 382 SQLSMALLINT * TextLengthPtr); 383 384 385 #define N3SQLGetDiagRec(a,b,c,d,e,f,g,h) (*(T3SQLGetDiagRec)getOdbcFunction(ODBC3SQLGetDiagRec))(a,b,c,d,e,f,g,h) 386 387 // Obtaining information about the data source's system tables (catalog functions) 388 typedef SQLRETURN (SQL_API *T3SQLColumnPrivileges) (SQLHSTMT StatementHandle, 389 SQLCHAR * CatalogName, 390 SQLSMALLINT NameLength1, 391 SQLCHAR * SchemaName, 392 SQLSMALLINT NameLength2, 393 SQLCHAR * TableName, 394 SQLSMALLINT NameLength3, 395 SQLCHAR * ColumnName, 396 SQLSMALLINT NameLength4); 397 398 #define N3SQLColumnPrivileges(a,b,c,d,e,f,g,h,i) (*(T3SQLColumnPrivileges)getOdbcFunction(ODBC3SQLColumnPrivileges))(a,b,c,d,e,f,g,h,i) 399 400 typedef SQLRETURN (SQL_API *T3SQLColumns) ( SQLHSTMT StatementHandle, 401 SQLCHAR * CatalogName, 402 SQLSMALLINT NameLength1, 403 SQLCHAR * SchemaName, 404 SQLSMALLINT NameLength2, 405 SQLCHAR * TableName, 406 SQLSMALLINT NameLength3, 407 SQLCHAR * ColumnName, 408 SQLSMALLINT NameLength4); 409 410 #define N3SQLColumns(a,b,c,d,e,f,g,h,i) (*(T3SQLColumns)getOdbcFunction(ODBC3SQLColumns))(a,b,c,d,e,f,g,h,i) 411 412 typedef SQLRETURN (SQL_API *T3SQLForeignKeys) ( SQLHSTMT StatementHandle, 413 SQLCHAR * PKCatalogName, 414 SQLSMALLINT NameLength1, 415 SQLCHAR * PKSchemaName, 416 SQLSMALLINT NameLength2, 417 SQLCHAR * PKTableName, 418 SQLSMALLINT NameLength3, 419 SQLCHAR * FKCatalogName, 420 SQLSMALLINT NameLength4, 421 SQLCHAR * FKSchemaName, 422 SQLSMALLINT NameLength5, 423 SQLCHAR * FKTableName, 424 SQLSMALLINT NameLength6); 425 426 #define N3SQLForeignKeys(a,b,c,d,e,f,g,h,i,j,k,l,m) (*(T3SQLForeignKeys)getOdbcFunction(ODBC3SQLForeignKeys))(a,b,c,d,e,f,g,h,i,j,k,l,m) 427 428 typedef SQLRETURN (SQL_API *T3SQLPrimaryKeys) ( SQLHSTMT StatementHandle, 429 SQLCHAR * CatalogName, 430 SQLSMALLINT NameLength1, 431 SQLCHAR * SchemaName, 432 SQLSMALLINT NameLength2, 433 SQLCHAR * TableName, 434 SQLSMALLINT NameLength3); 435 436 #define N3SQLPrimaryKeys(a,b,c,d,e,f,g) (*(T3SQLPrimaryKeys)getOdbcFunction(ODBC3SQLPrimaryKeys))(a,b,c,d,e,f,g) 437 438 typedef SQLRETURN (SQL_API *T3SQLProcedureColumns) (SQLHSTMT StatementHandle, 439 SQLCHAR * CatalogName, 440 SQLSMALLINT NameLength1, 441 SQLCHAR * SchemaName, 442 SQLSMALLINT NameLength2, 443 SQLCHAR * ProcName, 444 SQLSMALLINT NameLength3, 445 SQLCHAR * ColumnName, 446 SQLSMALLINT NameLength4); 447 448 #define N3SQLProcedureColumns(a,b,c,d,e,f,g,h,i) (*(T3SQLProcedureColumns)getOdbcFunction(ODBC3SQLProcedureColumns))(a,b,c,d,e,f,g,h,i) 449 450 typedef SQLRETURN (SQL_API *T3SQLProcedures) ( SQLHSTMT StatementHandle, 451 SQLCHAR * CatalogName, 452 SQLSMALLINT NameLength1, 453 SQLCHAR * SchemaName, 454 SQLSMALLINT NameLength2, 455 SQLCHAR * ProcName, 456 SQLSMALLINT NameLength3); 457 458 #define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g) 459 460 typedef SQLRETURN (SQL_API *T3SQLSpecialColumns) (SQLHSTMT StatementHandle, 461 SQLUSMALLINT IdentifierType, 462 SQLCHAR * CatalogName, 463 SQLSMALLINT NameLength1, 464 SQLCHAR * SchemaName, 465 SQLSMALLINT NameLength2, 466 SQLCHAR * TableName, 467 SQLSMALLINT NameLength3, 468 SQLUSMALLINT Scope, 469 SQLUSMALLINT Nullable); 470 471 #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j) 472 473 typedef SQLRETURN (SQL_API *T3SQLStatistics) ( SQLHSTMT StatementHandle, 474 SQLCHAR * CatalogName, 475 SQLSMALLINT NameLength1, 476 SQLCHAR * SchemaName, 477 SQLSMALLINT NameLength2, 478 SQLCHAR * TableName, 479 SQLSMALLINT NameLength3, 480 SQLUSMALLINT Unique, 481 SQLUSMALLINT Reserved); 482 483 #define N3SQLStatistics(a,b,c,d,e,f,g,h,i) (*(T3SQLStatistics)getOdbcFunction(ODBC3SQLStatistics))(a,b,c,d,e,f,g,h,i) 484 485 typedef SQLRETURN (SQL_API *T3SQLTablePrivileges) (SQLHSTMT StatementHandle, 486 SQLCHAR * CatalogName, 487 SQLSMALLINT NameLength1, 488 SQLCHAR * SchemaName, 489 SQLSMALLINT NameLength2, 490 SQLCHAR * TableName, 491 SQLSMALLINT NameLength3); 492 493 #define N3SQLTablePrivileges(a,b,c,d,e,f,g) (*(T3SQLTablePrivileges)getOdbcFunction(ODBC3SQLTablePrivileges))(a,b,c,d,e,f,g) 494 495 typedef SQLRETURN (SQL_API *T3SQLTables) ( SQLHSTMT StatementHandle, 496 SQLCHAR * CatalogName, 497 SQLSMALLINT NameLength1, 498 SQLCHAR * SchemaName, 499 SQLSMALLINT NameLength2, 500 SQLCHAR * TableName, 501 SQLSMALLINT NameLength3, 502 SQLCHAR * TableType, 503 SQLSMALLINT NameLength4); 504 505 #define N3SQLTables(a,b,c,d,e,f,g,h,i) (*(T3SQLTables)getOdbcFunction(ODBC3SQLTables))(a,b,c,d,e,f,g,h,i) 506 507 // Terminating a statement 508 typedef SQLRETURN (SQL_API *T3SQLFreeStmt) ( SQLHSTMT StatementHandle, 509 SQLUSMALLINT Option); 510 511 #define N3SQLFreeStmt(a,b) (*(T3SQLFreeStmt)getOdbcFunction(ODBC3SQLFreeStmt))(a,b) 512 513 typedef SQLRETURN (SQL_API *T3SQLCloseCursor) (SQLHSTMT StatementHandle); 514 515 #define N3SQLCloseCursor(a) (*(T3SQLCloseCursor)getOdbcFunction(ODBC3SQLCloseCursor))(a) 516 517 typedef SQLRETURN (SQL_API *T3SQLCancel) ( SQLHSTMT StatementHandle); 518 519 #define N3SQLCancel(a) (*(T3SQLCancel)getOdbcFunction(ODBC3SQLCancel))(a) 520 521 typedef SQLRETURN (SQL_API *T3SQLEndTran) ( SQLSMALLINT HandleType, 522 SQLHANDLE Handle, 523 SQLSMALLINT CompletionType); 524 525 #define N3SQLEndTran(a,b,c) (*(T3SQLEndTran)getOdbcFunction(ODBC3SQLEndTran))(a,b,c) 526 527 // Terminating a connection 528 typedef SQLRETURN (SQL_API *T3SQLDisconnect) (SQLHDBC ConnectionHandle); 529 530 #define N3SQLDisconnect(a) (*(T3SQLDisconnect)getOdbcFunction(ODBC3SQLDisconnect))(a) 531 532 typedef SQLRETURN (SQL_API *T3SQLFreeHandle) (SQLSMALLINT HandleType, 533 SQLHANDLE Handle); 534 535 #define N3SQLFreeHandle(a,b) (*(T3SQLFreeHandle)getOdbcFunction(ODBC3SQLFreeHandle))(a,b) 536 537 typedef SQLRETURN (SQL_API *T3SQLGetCursorName) ( SQLHSTMT StatementHandle, 538 SQLCHAR * CursorName, 539 SQLSMALLINT BufferLength, 540 SQLSMALLINT* NameLength2); 541 542 #define N3SQLGetCursorName(a,b,c,d) (*(T3SQLGetCursorName)getOdbcFunction(ODBC3SQLGetCursorName))(a,b,c,d) 543 544 typedef SQLRETURN (SQL_API *T3SQLNativeSql) ( SQLHSTMT ConnectionHandle, 545 SQLCHAR * InStatementText, 546 SQLINTEGER TextLength1, 547 SQLCHAR * OutStatementText, 548 SQLINTEGER BufferLength, 549 SQLINTEGER * TextLength2Ptr); 550 551 #define N3SQLNativeSql(a,b,c,d,e,f) (*(T3SQLNativeSql)getOdbcFunction(ODBC3SQLNativeSql))(a,b,c,d,e,f) 552 } 553 554 #endif // _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_ 555 556 557