8#if __DCL_HAVE_ALLOC_DEBUG
9#undef __DCL_ALLOC_LEVEL
10#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
22#define __DCL_TRACE0_N __DCL_TRACE0
23#define __DCL_TRACE1_N __DCL_TRACE1
24#define __DCL_TRACE2_N __DCL_TRACE2
25#define __DCL_TRACE3_N __DCL_TRACE3
26#define __DCL_TRACE4_N __DCL_TRACE4
28#define __DCL_TRACE0_N(fmt)
29#define __DCL_TRACE1_N(fmt, arg)
30#define __DCL_TRACE2_N(fmt, arg1, arg2)
31#define __DCL_TRACE3_N(fmt, arg1, arg2, arg3)
32#define __DCL_TRACE4_N(fmt, arg1, arg2, arg3, arg4)
41#define __SET_ERROR(_error, status, pError) \
42 conn()->setErrorStatus(_error, status, pError, \
43 true, __THIS_FILE__, __LINE__)
45#define __SET_ERROR_NORESET(_error, status, pError) \
46 conn()->setErrorStatus(_error, status, pError, \
47 false, __THIS_FILE__, __LINE__)
59 Query::__placeholder = L
':';
68 ByteBuffer*
buf = ByteBuffer::create(
n);
69 bool b = conn()->__getErrorMessage(
buf->data(), &
n);
71 buf->__dataLength =
n;
96 Query::__affectedRows = -1;
104 Query::__fieldCount = 0;
112 Query::__paramCount = 0;
116 sword status = ::OCIStmtRelease(
118 conn()->errorHandle(),
122 if (status != OCI_SUCCESS) {
134#if defined(__DCL_DEBUG) && 1
138 text* bvnp; ub1 bvnl;
139 text* invp; ub1 inpl;
140 ub1 dupl; OCIBind* hndl;
142 sword status = ::OCIStmtGetBindInfo(
144 conn()->errorHandle(),
145 size, startloc, &found,
146 &bvnp, &bvnl, &invp, &inpl,
149 if (status != OCI_SUCCESS) {
150 if (status == OCI_NO_DATA) {
160 Query::__paramCount = _paramCount;
167 for(
size_t i = 0; i < Query::__paramCount; i++) {
184 sword status = OCI_SUCCESS;
186 status = ::OCIStmtPrepare2(
195 if (status != OCI_SUCCESS) {
200 status = ::OCIAttrGet(
__stmt,
206 if (status != OCI_SUCCESS) {
211 if (_paramCount > 0) {
223 sword status = OCI_SUCCESS;
226 status = ::OCIAttrGet(
__stmt,
230 OCI_ATTR_PARAM_COUNT,
232 if (status != OCI_SUCCESS) {
237 Query::__fieldCount = nFieldCount;
244 for(
size_t i = 0; i < Query::__fieldCount; i++) {
254 for(
size_t i = 0; i < Query::__paramCount; i++) {
262 sword status = OCI_SUCCESS;
263 status = ::OCIStmtExecute(
272 if (status != OCI_SUCCESS) {
284 Query::__eof =
false;
287 for(
size_t i = 0; i < Query::__paramCount; i++) {
304 ub8 nAffectedRows = 0;
305 status = ::OCIAttrGet(
__stmt,
309 OCI_ATTR_UB8_ROW_COUNT,
311 if (status != OCI_SUCCESS) {
315 Query::__affectedRows = nAffectedRows;
322 OCIError* pError = conn()->errorHandle();
323 sword status = ::OCIStmtFetch2(
329 if (status == OCI_SUCCESS) {
330 for(
size_t i = 0; i < Query::__fieldCount; i++) {
336 else if (status == OCI_NO_DATA) {
348 __DCL_ASSERT((0 <= _index) && (_index < Query::__fieldCount));
349 *_fieldHandleOut = &
__fields[_index];
356 __DCL_ASSERT((0 <= _index) && (_index < Query::__paramCount));
357 *_paramHandleOut = &
__params[_index];
#define __DCL_TRACE2_N(fmt, arg1, arg2)
#define __DCL_TRACE0(psz)
#define __DCL_TRACE1(fmt, arg1)
#define __DCL_ASSERT(expr)
#define IMPLEMENT_CLASSINFO(class_name, base_class_name)
#define __SET_ERROR_NORESET(_error, status, pError)
#define _OCI_STMT_TYPE_UNKNOWN
#define __SET_ERROR(_errorCode)
void CharsetConvertException *size_t n
OCISvcCtx * svcctxHandle() const
OCIError * errorHandle() const
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)