Blame include/private/apr_dbd_odbc_v2.h

Packit 383869
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 383869
 * contributor license agreements.  See the NOTICE file distributed with
Packit 383869
 * this work for additional information regarding copyright ownership.
Packit 383869
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 383869
 * (the "License"); you may not use this file except in compliance with
Packit 383869
 * the License.  You may obtain a copy of the License at
Packit 383869
 *
Packit 383869
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 383869
 *
Packit 383869
 * Unless required by applicable law or agreed to in writing, software
Packit 383869
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 383869
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 383869
 * See the License for the specific language governing permissions and
Packit 383869
 * limitations under the License.
Packit 383869
 */
Packit 383869
Packit 383869
Packit 383869
/*  ONLY USED FOR ODBC Version 2   -DODBCV2
Packit 383869
*
Packit 383869
*   Re-define everything to work (more-or-less) in an ODBC V2 environment
Packit 383869
*       Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select() cannot
Packit 383869
*       have a 'random' argument of 1.  apr_dbd_get_row() must always pass rownum as 0 (get next row)
Packit 383869
*
Packit 383869
*/
Packit 383869
Packit 383869
#define SQLHANDLE SQLHENV /* Presumes that ENV, DBC, and STMT handles are all the same datatype */
Packit 383869
#define SQL_NULL_HANDLE 0
Packit 383869
#define SQL_HANDLE_STMT 1
Packit 383869
#define SQL_HANDLE_DBC  2
Packit 383869
#define SQL_HANDLE_ENV  3
Packit 383869
#define SQL_NO_DATA     SQL_NO_DATA_FOUND
Packit 383869
Packit 383869
#ifndef SQL_SUCCEEDED
Packit 383869
#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
Packit 383869
#endif
Packit 383869
Packit 383869
#undef SQLSetEnvAttr
Packit 383869
#define SQLSetEnvAttr(henv, Attribute, Value, StringLength)  (0)
Packit 383869
Packit 383869
#undef SQLAllocHandle
Packit 383869
#define SQLAllocHandle(type, parent, hndl) \
Packit 383869
(     (type == SQL_HANDLE_STMT) ? SQLAllocStmt(parent, hndl) \
Packit 383869
    : (type == SQL_HANDLE_ENV)  ? SQLAllocEnv(hndl) \
Packit 383869
    :                             SQLAllocConnect(parent, hndl)  \
Packit 383869
)
Packit 383869
Packit 383869
#undef SQLFreeHandle
Packit 383869
#define SQLFreeHandle(type, hndl) \
Packit 383869
(     (type == SQL_HANDLE_STMT) ? SQLFreeStmt(hndl, SQL_DROP) \
Packit 383869
    : (type == SQL_HANDLE_ENV)  ? SQLFreeEnv(hndl) \
Packit 383869
    :                             SQLFreeConnect(hndl)  \
Packit 383869
)
Packit 383869
Packit 383869
#undef SQLGetDiagRec
Packit 383869
#define SQLGetDiagRec(type, h, i, state, native, buffer, bufsize, reslen) \
Packit 383869
        SQLError(  (type == SQL_HANDLE_ENV) ? h : NULL, \
Packit 383869
                   (type == SQL_HANDLE_DBC) ? h : NULL, \
Packit 383869
                   (type == SQL_HANDLE_STMT) ? h : NULL, \
Packit 383869
                   state, native, buffer, bufsize, reslen)
Packit 383869
Packit 383869
#undef SQLCloseCursor
Packit 383869
#define SQLCloseCursor(stmt) SQLFreeStmt(stmt, SQL_CLOSE)
Packit 383869
Packit 383869
#undef SQLGetConnectAttr
Packit 383869
#define SQLGetConnectAttr(hdbc, fOption, ValuePtr, BufferLength, NULL) \
Packit 383869
    SQLGetConnectOption(hdbc, fOption, ValuePtr)
Packit 383869
Packit 383869
#undef SQLSetConnectAttr
Packit 383869
#define SQLSetConnectAttr(hdbc, fOption, ValuePtr, BufferLength) \
Packit 383869
        SQLSetConnectOption(hdbc, fOption, (SQLUINTEGER) ValuePtr)
Packit 383869
Packit 383869
#undef SQLSetStmtAttr
Packit 383869
#define SQLSetStmtAttr(hstmt, fOption, ValuePtr, BufferLength) (0); return APR_ENOTIMPL;
Packit 383869
Packit 383869
#undef SQLEndTran
Packit 383869
#define SQLEndTran(hType, hdbc,type)  SQLTransact(henv, hdbc, type)
Packit 383869
Packit 383869
#undef SQLFetchScroll
Packit 383869
#define SQLFetchScroll(stmt, orient, rownum) (0); return APR_ENOTIMPL;
Packit 383869
Packit 383869
#define SQL_DESC_TYPE           SQL_COLUMN_TYPE
Packit 383869
#define SQL_DESC_CONCISE_TYPE   SQL_COLUMN_TYPE
Packit 383869
#define SQL_DESC_DISPLAY_SIZE   SQL_COLUMN_DISPLAY_SIZE
Packit 383869
#define SQL_DESC_OCTET_LENGTH   SQL_COLUMN_LENGTH
Packit 383869
#define SQL_DESC_UNSIGNED       SQL_COLUMN_UNSIGNED
Packit 383869
Packit 383869
#undef SQLColAttribute
Packit 383869
#define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n)
Packit 383869
Packit 383869
#define SQL_ATTR_ACCESS_MODE            SQL_ACCESS_MODE
Packit 383869
#define SQL_ATTR_AUTOCOMMIT             SQL_AUTOCOMMIT
Packit 383869
#define SQL_ATTR_CONNECTION_TIMEOUT     113
Packit 383869
#define SQL_ATTR_CURRENT_CATALOG        SQL_CURRENT_QUALIFIER
Packit 383869
#define SQL_ATTR_DISCONNECT_BEHAVIOR    114
Packit 383869
#define SQL_ATTR_ENLIST_IN_DTC          1207
Packit 383869
#define SQL_ATTR_ENLIST_IN_XA           1208
Packit 383869
Packit 383869
#define SQL_ATTR_CONNECTION_DEAD        1209
Packit 383869
#define SQL_CD_TRUE                     1L   /* Connection is closed/dead */
Packit 383869
#define SQL_CD_FALSE                    0L   /* Connection is open/available */
Packit 383869
Packit 383869
#define SQL_ATTR_LOGIN_TIMEOUT          SQL_LOGIN_TIMEOUT
Packit 383869
#define SQL_ATTR_ODBC_CURSORS           SQL_ODBC_CURSORS
Packit 383869
#define SQL_ATTR_PACKET_SIZE            SQL_PACKET_SIZE
Packit 383869
#define SQL_ATTR_QUIET_MODE             SQL_QUIET_MODE
Packit 383869
#define SQL_ATTR_TRACE                  SQL_OPT_TRACE
Packit 383869
#define SQL_ATTR_TRACEFILE              SQL_OPT_TRACEFILE
Packit 383869
#define SQL_ATTR_TRANSLATE_LIB          SQL_TRANSLATE_DLL
Packit 383869
#define SQL_ATTR_TRANSLATE_OPTION       SQL_TRANSLATE_OPTION
Packit 383869
#define SQL_ATTR_TXN_ISOLATION          SQL_TXN_ISOLATION
Packit 383869
Packit 383869
#define SQL_ATTR_CURSOR_SCROLLABLE -1
Packit 383869
Packit 383869
#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET)   /* SIGNED BIGINT */
Packit 383869
#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
Packit 383869
Packit 383869
#define SQL_FALSE           0
Packit 383869
#define SQL_TRUE            1
Packit 383869