26 #define SQLHANDLE SQLHENV
27 #define SQL_NULL_HANDLE 0
28 #define SQL_HANDLE_STMT 1
29 #define SQL_HANDLE_DBC 2
30 #define SQL_HANDLE_ENV 3
31 #define SQL_NO_DATA SQL_NO_DATA_FOUND
34 #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
38 #define SQLSetEnvAttr(henv, Attribute, Value, StringLength) (0)
41 #define SQLAllocHandle(type, parent, hndl) \
42 ( (type == SQL_HANDLE_STMT) ? SQLAllocStmt(parent, hndl) \
43 : (type == SQL_HANDLE_ENV) ? SQLAllocEnv(hndl) \
44 : SQLAllocConnect(parent, hndl) \
48 #define SQLFreeHandle(type, hndl) \
49 ( (type == SQL_HANDLE_STMT) ? SQLFreeStmt(hndl, SQL_DROP) \
50 : (type == SQL_HANDLE_ENV) ? SQLFreeEnv(hndl) \
51 : SQLFreeConnect(hndl) \
55 #define SQLGetDiagRec(type, h, i, state, native, buffer, bufsize, reslen) \
56 SQLError( (type == SQL_HANDLE_ENV) ? h : NULL, \
57 (type == SQL_HANDLE_DBC) ? h : NULL, \
58 (type == SQL_HANDLE_STMT) ? h : NULL, \
59 state, native, buffer, bufsize, reslen)
62 #define SQLCloseCursor(stmt) SQLFreeStmt(stmt, SQL_CLOSE)
64 #undef SQLGetConnectAttr
65 #define SQLGetConnectAttr(hdbc, fOption, ValuePtr, BufferLength, NULL) \
66 SQLGetConnectOption(hdbc, fOption, ValuePtr)
68 #undef SQLSetConnectAttr
69 #define SQLSetConnectAttr(hdbc, fOption, ValuePtr, BufferLength) \
70 SQLSetConnectOption(hdbc, fOption, (SQLUINTEGER) ValuePtr)
73 #define SQLSetStmtAttr(hstmt, fOption, ValuePtr, BufferLength) (0); return APR_ENOTIMPL;
76 #define SQLEndTran(hType, hdbc,type) SQLTransact(henv, hdbc, type)
79 #define SQLFetchScroll(stmt, orient, rownum) (0); return APR_ENOTIMPL;
81 #define SQL_DESC_TYPE SQL_COLUMN_TYPE
82 #define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE
83 #define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE
84 #define SQL_DESC_OCTET_LENGTH SQL_COLUMN_LENGTH
85 #define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED
87 #undef SQLColAttribute
88 #define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n)
90 #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
91 #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
92 #define SQL_ATTR_CONNECTION_TIMEOUT 113
93 #define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
94 #define SQL_ATTR_DISCONNECT_BEHAVIOR 114
95 #define SQL_ATTR_ENLIST_IN_DTC 1207
96 #define SQL_ATTR_ENLIST_IN_XA 1208
98 #define SQL_ATTR_CONNECTION_DEAD 1209
99 #define SQL_CD_TRUE 1L
100 #define SQL_CD_FALSE 0L
102 #define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
103 #define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
104 #define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
105 #define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
106 #define SQL_ATTR_TRACE SQL_OPT_TRACE
107 #define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
108 #define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
109 #define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
110 #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
112 #define SQL_ATTR_CURSOR_SCROLLABLE -1
114 #define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET)
115 #define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET)