5#if defined(_AIX) || defined(__sun__)
12#if __DCL_HAVE_ALLOC_DEBUG
13#undef __DCL_ALLOC_LEVEL
14#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
27#define __DCL_TRACE0_N __DCL_TRACE0
28#define __DCL_TRACE1_N __DCL_TRACE1
29#define __DCL_TRACE2_N __DCL_TRACE2
30#define __DCL_TRACE3_N __DCL_TRACE3
31#define __DCL_TRACE4_N __DCL_TRACE4
32#define __DCL_TRACE5_N __DCL_TRACE5
33#define __DCL_TRACE6_N __DCL_TRACE6
35#define __DCL_TRACE0_N(fmt)
36#define __DCL_TRACE1_N(fmt, arg)
37#define __DCL_TRACE2_N(fmt, arg1, arg2)
38#define __DCL_TRACE3_N(fmt, arg1, arg2, arg3)
39#define __DCL_TRACE4_N(fmt, arg1, arg2, arg3, arg4)
40#define __DCL_TRACE5_N(fmt, arg1, arg2, arg3, arg4, arg5)
41#define __DCL_TRACE6_N(fmt, arg1, arg2, arg3, arg4, arg5, arg6)
49#define __SET_ERROR_HANDLE(_error, _status, _OCIError) \
50 conn()->setErrorHandle(_error, _status, _OCIError, \
51 true, __THIS_FILE__, __LINE__)
52#define __SET_ERROR_NORESET(_error, _status, _OCIError) \
53 conn()->setErrorHandle(_error, _status, _OCIError, \
54 false, __THIS_FILE__, __LINE__)
55#define __SET_ERROR_MSG(_msg) \
56 conn()->setErrorMessage(_msg, __THIS_FILE__, __LINE__)
63 Query::__placeholder = L
':';
68 __fieldsBuffer =
NULL;
79 size_t buflen =
sizeof(buf) - 1;
80 bool b = conn()->__getErrorMessage(buf, &buflen);
81 buf[b ? buflen : 0] =
'\0';
97 Query::__affectedRows = -1;
104 Query::__fieldCount = 0;
111 Query::__paramCount = 0;
120 sword status = OCIStmtRelease(
122 conn()->errorHandle(),
127 if (status != OCI_SUCCESS) {
141 && (Query::__paramCount == 0)
145#if defined(__DCL_DEBUG) && 1
147 ub4 size =
sizeof(bindCount);
148 sword status = OCIAttrGet(
154 conn()->errorHandle()
157 if (status != OCI_SUCCESS) {
164 Query::__paramCount = _paramCount;
171 for(ub4 i = 0; i < Query::__paramCount; i++) {
187 && (Query::__fieldCount == 0)
193 ub4 size =
sizeof(fieldCount);
194 sword status = OCIAttrGet(
199 OCI_ATTR_PARAM_COUNT,
200 conn()->errorHandle()
203 if (status != OCI_SUCCESS) {
209 for (ub4 i = 0; i < fieldCount; i++) {
210 OCIParam* param =
NULL;
211 status = OCIParamGet(
214 conn()->errorHandle(),
218 if (status != OCI_SUCCESS) {
231 conn()->errorHandle()
234 if (status != OCI_SUCCESS) {
242 size =
sizeof(dataSize);
249 conn()->errorHandle()
252 if (status != OCI_SUCCESS) {
260 i + 1, dataSize, ts[i].buflen,
267 for (ub4 i = 0; i < fieldCount; i++) {
282 Query::__fieldCount = fieldCount;
290 for (ub4 i = 0; i < Query::__fieldCount; i++) {
294 if (!(
__fields[i].init(
this, i + 1, ts[i].sqlt,
306 const char* _sql,
size_t _sqllen,
314 sword status = OCIStmtPrepare2(
317 conn()->errorHandle(),
325 if (status != OCI_SUCCESS) {
337 conn()->errorHandle()
340 if (status != OCI_SUCCESS) {
345 if (_paramCount > 0) {
355 for(
size_t i = 0; i < Query::__paramCount; i++) {
360 sword status = OCIStmtExecute(
363 conn()->errorHandle(),
370 if (status != OCI_SUCCESS) {
381 Query::__eof =
false;
384 for(
size_t i = 0; i < Query::__paramCount; i++) {
385 if (!
__params[i].onAfterExecute()) {
395 ub4 size =
sizeof(rowCount);
401 OCI_ATTR_UB8_ROW_COUNT,
402 conn()->errorHandle()
405 if (status != OCI_SUCCESS) {
409 Query::__affectedRows = rowCount;
417 sword status = OCIStmtFetch2(
419 conn()->errorHandle(),
430 case OCI_SUCCESS_WITH_INFO: {
437 for (
size_t i = 0; i < Query::__fieldCount; i++) {
455 __DCL_ASSERT((0 <= _index) && (_index < Query::__fieldCount));
456 *_fieldHandleOut = &
__fields[_index];
463 __DCL_ASSERT((0 <= _index) && (_index < Query::__paramCount));
464 *_paramHandleOut = &
__params[_index];
#define __DCL_TRACE1_N(fmt, arg)
#define __SET_ERROR_HANDLE(_SQLCODE)
#define __DCL_TRACE5_N(fmt, arg1, arg2, arg3, arg4, arg5)
#define __DCL_TRACE1(fmt, arg1)
#define __DCL_ASSERT(expr)
#define IMPLEMENT_CLASSINFO(class_name, base_class_name)
#define __SET_ERROR_NORESET(_error, _status, _OCIError)
struct __TYPESIZE TYPESIZE
#define __OCI_STMT_TYPE_UNKNOWN
static const wchar_t * __TYPE_NAME(ub2 _sqlt)
static size_t __TYPE_ALIGN(size_t _offset, ub2 _sqlt)
static ub4 __TYPE_SIZE(ub2 _sqlt, ub4 _size)
virtual bool __getParam(size_t _index, SQL::Param **_paramHandleOut)
OciQuery(OciConnection *_connHandle)
virtual bool __getField(size_t _index, SQL::Field **_fieldHandleOut)
virtual bool __prepare(const char *_sql, size_t _sqllen, size_t _paramCount)
bool initParams(size_t _paramCount)