DCL 4.0
Loading...
Searching...
No Matches
IFXQuery Class Reference

#include <IFXQuery.h>

Inheritance diagram for IFXQuery:
SQL::Query Object

Public Member Functions

 IFXQuery (IFXConnection *pConnection)
virtual ~IFXQuery ()
virtual void __destroy ()
virtual bool __prepare (const char *_sql, size_t _sqllen, size_t _paramCount)
virtual bool __execute ()
virtual bool __fetch ()
virtual bool __getField (size_t _index, SQL::Field **_fieldHandleOut)
virtual bool __getParam (size_t _index, SQL::Param **_paramHandleOut)
Public Member Functions inherited from Object
virtual String toString () const
virtual void destroy ()
String className () const
bool isInstanceOf (const std::type_info &typeinfo) const
virtual const std::type_info & typeInfo () const

Protected Member Functions

bool reset ()
bool initFields ()
bool initParams (size_t _paramCount)
Protected Member Functions inherited from SQL::Query
 Query (Connection *_connHandle)
virtual ~Query ()
virtual bool __nextResult ()
Protected Member Functions inherited from Object
virtual ~Object ()
 Object ()

Protected Attributes

ByteString __statementID
ByteString __cursorID
ifx_sqlda_t * __inSQLDA
ifx_sqlda_t * __outSQLDA
void * __outBuffer
bool __cursorDeclared
bool __cursorOpened
IFXParam__params
IFXField__fields
Protected Attributes inherited from SQL::Query
Connection__connHandle
bool __eof
int64_t __affectedRows
size_t __fieldCount
size_t __paramCount
wchar_t __placeholder
unsigned int __states

Additional Inherited Members

Public Types inherited from SQL::Query
enum  State { stStandBy = 0x0001 , stPrepared = 0x0002 , stExecuted = 0x0004 , stFetched = 0x0008 }

Detailed Description

Definition at line 15 of file IFXQuery.h.

Constructor & Destructor Documentation

◆ IFXQuery()

IFXQuery::IFXQuery ( IFXConnection * pConnection)

◆ ~IFXQuery()

IFXQuery::~IFXQuery ( )
virtual

Definition at line 90 of file IFXQuery.cpp.

91{
92#ifdef __DCL_DEBUG
93 if (!reset()) {
94 ByteString s;
95 size_t n = 512;
96 ByteBuffer* buf = ByteBuffer::create(n);
97 bool b = conn()->__getErrorMessage(buf->data(), &n);
98 if (b) {
99 buf->__dataLength = n;
100 s = buf;
101 }
102 buf->release();
103
104 if (b) {
105 __DCL_TRACE1(__T("Warning! %s\n"), s.data());
106 }
107 else {
108 __DCL_TRACE0(__T("Warning! Query reset error\n"));
109 }
110 }
111#else
112 (void)reset();
113#endif
114}
#define __DCL_TRACE0(psz)
Definition Object.h:375
#define __DCL_TRACE1(fmt, arg1)
Definition Object.h:376
#define __T(str)
Definition Object.h:44
ByteBuffer * buf
void CharsetConvertException *size_t n
Definition SQLField.cpp:253
bool reset()
Definition IFXQuery.cpp:122

Member Function Documentation

◆ __destroy()

void IFXQuery::__destroy ( )
virtual

Implements SQL::Query.

Definition at line 116 of file IFXQuery.cpp.

117{
118// cerr << "IFXQuery::destory\n";
119 delete this;
120}

◆ __execute()

bool IFXQuery::__execute ( )
virtual

Implements SQL::Query.

Definition at line 476 of file IFXQuery.cpp.

477{
478/*
479 * EXEC SQL BEGIN DECLARE SECTION;
480 */
481#line 386 "ifxquery.ec"
482#line 387 "ifxquery.ec"
483 char *pszConnectionID = conn()->connectionID();
484 char *pszStatementID = (_CONST char*)__statementID.data();
485 char *pszCursorID = (_CONST char*)__cursorID.data();
486/*
487 * EXEC SQL END DECLARE SECTION;
488 */
489#line 390 "ifxquery.ec"
490
491
492/*
493 * EXEC SQL SET CONNECTION :pszConnectionID;
494 */
495#line 392 "ifxquery.ec"
496 {
497#line 392 "ifxquery.ec"
498 sqli_connect_set(0, pszConnectionID, 0);
499#line 392 "ifxquery.ec"
500 }
501 if (SQLCODE < 0) {
502 __SET_ERROR_SQLCODE(SQLCODE);
503 return false;
504 }
505 __DCL_ASSERT(SQLCODE == 0);
506
507 //if (__stmtType == SQ_SELECT) {
508 if (__outSQLDA && __outSQLDA->sqld > 0) {
509 if (!__cursorDeclared) {
510/*
511 * EXEC SQL DECLARE :pszCursorID CURSOR FOR :pszStatementID;
512 */
513#line 402 "ifxquery.ec"
514 {
515#line 402 "ifxquery.ec"
516 sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszCursorID, 0), pszCursorID, sqli_curs_locate(ESQLINTVERSION, pszStatementID, 1), 0, 0);
517#line 402 "ifxquery.ec"
518 }
519 if (SQLCODE < 0) {
520 __SET_ERROR_SQLCODE(SQLCODE);
521 return false;
522 }
523 __cursorDeclared = true;
524 }
525
526 if (__cursorOpened) {
527/*
528 * EXEC SQL CLOSE :pszCursorID;
529 */
530#line 411 "ifxquery.ec"
531 {
532#line 411 "ifxquery.ec"
533 sqli_curs_close(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszCursorID, 256));
534#line 411 "ifxquery.ec"
535 }
536 if (SQLCODE < 0) {
537 __SET_ERROR_SQLCODE(SQLCODE);
538 return false;
539 }
540 __cursorOpened = false;
541 }
542
543 if (__inSQLDA)
544/*
545 * EXEC SQL OPEN :pszCursorID USING DESCRIPTOR __inSQLDA;
546 */
547#line 420 "ifxquery.ec"
548 {
549#line 420 "ifxquery.ec"
550 sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszCursorID, 256), __inSQLDA, (char *)0, (struct value *)0, 1, 0);
551#line 420 "ifxquery.ec"
552 }
553 else
554/*
555 * EXEC SQL OPEN :pszCursorID;
556 */
557#line 422 "ifxquery.ec"
558 {
559#line 422 "ifxquery.ec"
560 sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszCursorID, 256), (ifx_sqlda_t *)0, (char *)0, (struct value *)0, 0, 0);
561#line 422 "ifxquery.ec"
562 }
563
564 if (SQLCODE < 0) {
565 __SET_ERROR_SQLCODE(SQLCODE);
566 return false;
567 }
568
569 __cursorOpened = true;
570 __eof = false;
571 }
572 else {
573#if __USE_STMT_TYPE
574 // 2025.05.06 __outSQLDA 조건은 CURSOR로 처리 하므로
575 // 다음 EXEC SQL EXECUTE는 의미가 없다.
576 if (__outSQLDA && __inSQLDA)
577/*
578 * EXEC SQL EXECUTE :pszStatementID INTO DESCRIPTOR __outSQLDA
579 * USING DESCRIPTOR __inSQLDA;
580 */
581#line 437 "ifxquery.ec"
582 {
583#line 438 "ifxquery.ec"
584 sqli_exec(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszStatementID, 257), __inSQLDA, (char *)0, (struct value *)0, __outSQLDA, (char *)0, (struct value *)0, 0);
585#line 438 "ifxquery.ec"
586 }
587 else if (__outSQLDA)
588/*
589 * EXEC SQL EXECUTE :pszStatementID INTO DESCRIPTOR __outSQLDA;
590 */
591#line 440 "ifxquery.ec"
592 {
593#line 440 "ifxquery.ec"
594 sqli_exec(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszStatementID, 257), (ifx_sqlda_t *)0, (char *)0, (struct value *)0, __outSQLDA, (char *)0, (struct value *)0, 0);
595#line 440 "ifxquery.ec"
596 }
597 else
598#endif
599 if (__inSQLDA)
600/*
601 * EXEC SQL EXECUTE : pszStatementID USING DESCRIPTOR __inSQLDA;
602 */
603#line 444 "ifxquery.ec"
604 {
605#line 444 "ifxquery.ec"
606 sqli_exec(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszStatementID, 257), __inSQLDA, (char *)0, (struct value *)0, (ifx_sqlda_t *)0, (char *)0, (struct value *)0, 0);
607#line 444 "ifxquery.ec"
608 }
609 else
610/*
611 * EXEC SQL EXECUTE :pszStatementID;
612 */
613#line 446 "ifxquery.ec"
614 {
615#line 446 "ifxquery.ec"
616 sqli_exec(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszStatementID, 257), (ifx_sqlda_t *)0, (char *)0, (struct value *)0, (ifx_sqlda_t *)0, (char *)0, (struct value *)0, 0);
617#line 446 "ifxquery.ec"
618 }
619
620 if (SQLCODE < 0) {
621 __SET_ERROR_SQLCODE(SQLCODE);
622 Query::__affectedRows = -1;
623 return false;
624 }
625
626#if __USE_STMT_TYPE
627 if (__stmtType == SQ_EXECPROC) {
628 for(size_t i = 0; i < Query::__fieldCount; i++) {
629 if (!__fields[i].onAfterFetch())
630 return false;
631 }
632 }
633 else {
634 // INSERT, UPDATE, DELETE
635 Query::__affectedRows = sqlca.sqlerrd[2];
636 }
637#else
638 // INSERT, UPDATE, DELETE
639 Query::__affectedRows = sqlca.sqlerrd[2];
640#endif
641 }
642
643 for(size_t i = 0; i < Query::__paramCount; i++) {
644 if (!(__params[i].onAfterExecute()))
645 return false;
646 }
647
648 return true;
649}
#define _CONST
Definition Config.h:353
#define __SET_ERROR_SQLCODE(SQLCODE)
#define __DCL_ASSERT(expr)
Definition Object.h:371
bool __cursorOpened
Definition IFXQuery.h:38
IFXParam * __params
Definition IFXQuery.h:40
IFXField * __fields
Definition IFXQuery.h:41
ifx_sqlda_t * __inSQLDA
Definition IFXQuery.h:33
ByteString __statementID
Definition IFXQuery.h:27
bool __cursorDeclared
Definition IFXQuery.h:37
ifx_sqlda_t * __outSQLDA
Definition IFXQuery.h:34
ByteString __cursorID
Definition IFXQuery.h:28
bool __eof
Definition SQLCore.h:286

◆ __fetch()

bool IFXQuery::__fetch ( )
virtual

Implements SQL::Query.

Definition at line 651 of file IFXQuery.cpp.

652{
653 // SELECT, EXECUTE PROCEDURE
654 __DCL_ASSERT(!eof());
655 __DCL_ASSERT(__outSQLDA && __outSQLDA->sqld > 0);
656
657/*
658 * EXEC SQL BEGIN DECLARE SECTION;
659 */
660#line 485 "ifxquery.ec"
661#line 486 "ifxquery.ec"
662 char *pszCursorID = (_CONST char*)__cursorID.data();
663/*
664 * EXEC SQL END DECLARE SECTION;
665 */
666#line 487 "ifxquery.ec"
667
668
669/*
670 * EXEC SQL FETCH :pszCursorID USING DESCRIPTOR __outSQLDA;
671 */
672#line 489 "ifxquery.ec"
673 {
674#line 489 "ifxquery.ec"
675 static _FetchSpec _FS0 = { 0, 1, 0 };
676 sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszCursorID, 256), (ifx_sqlda_t *)0, __outSQLDA, (char *)0, &_FS0);
677#line 489 "ifxquery.ec"
678 }
679
680 if (SQLCODE == 0) {
681 for (size_t i = 0; i < Query::__fieldCount; i++) {
682 if (!__fields[i].onAfterFetch())
683 return false;
684 }
685 return true;
686 }
687 else if (SQLCODE == SQLNOTFOUND) {
688 Query::__eof = true;
689 return true;
690 }
691
692 __SET_ERROR_SQLCODE(SQLCODE);
693 return false;
694}

◆ __getField()

bool IFXQuery::__getField ( size_t _index,
SQL::Field ** _fieldHandleOut )
virtual

Implements SQL::Query.

Definition at line 696 of file IFXQuery.cpp.

697{
698 __DCL_ASSERT(Query::__fieldCount > 0);
699 __DCL_ASSERT((0 <= _index) && (_index < Query::__fieldCount));
700 *_fieldHandleOut = &__fields[_index];
701 return true;
702}

◆ __getParam()

bool IFXQuery::__getParam ( size_t _index,
SQL::Param ** _paramHandleOut )
virtual

Implements SQL::Query.

Definition at line 704 of file IFXQuery.cpp.

705{
706 __DCL_ASSERT(Query::__paramCount > 0);
707 __DCL_ASSERT((0 <= _index) && (_index < Query::__paramCount));
708 *_paramHandleOut = &__params[_index];
709 return true;
710}

◆ __prepare()

bool IFXQuery::__prepare ( const char * _sql,
size_t _sqllen,
size_t _paramCount )
virtual

Implements SQL::Query.

Definition at line 351 of file IFXQuery.cpp.

353{
354 if (!reset())
355 return false;
356
357/*
358 * EXEC SQL BEGIN DECLARE SECTION;
359 */
360#line 305 "ifxquery.ec"
361#line 306 "ifxquery.ec"
362 char *pszConnectionID = conn()->connectionID();
363 char *pszStatementID = (_CONST char*)__statementID.data();
364 char *pszSQL = (_CONST char*)_sql;
365/*
366 * EXEC SQL END DECLARE SECTION;
367 */
368#line 309 "ifxquery.ec"
369
370
371/*
372 * EXEC SQL SET CONNECTION : pszConnectionID;
373 */
374#line 311 "ifxquery.ec"
375 {
376#line 311 "ifxquery.ec"
377 sqli_connect_set(0, pszConnectionID, 0);
378#line 311 "ifxquery.ec"
379 }
380 if (SQLCODE < 0) {
381 __SET_ERROR_SQLCODE(SQLCODE);
382 return false;
383 }
384 __DCL_ASSERT(SQLCODE == 0);
385
386/*
387 * EXEC SQL PREPARE : pszStatementID FROM : pszSQL;
388 */
389#line 318 "ifxquery.ec"
390 {
391#line 318 "ifxquery.ec"
392 sqli_prep(ESQLINTVERSION, pszStatementID, pszSQL,(ifx_literal_t *)0, (ifx_namelist_t *)0, -1, 0, 0);
393#line 318 "ifxquery.ec"
394 }
395 if (SQLCODE < 0) {
396 __SET_ERROR_SQLCODE(SQLCODE);
397 return false;
398 }
399
400/*
401 * EXEC SQL DESCRIBE INPUT : pszStatementID INTO __inSQLDA;
402 */
403#line 324 "ifxquery.ec"
404 {
405#line 324 "ifxquery.ec"
406 sqli_describe_input_stmt(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszStatementID, 257), &__inSQLDA, 0);
407#line 324 "ifxquery.ec"
408 }
409 if (SQLCODE < 0) {
410 __SET_ERROR_SQLCODE(SQLCODE);
411 return false;
412 }
413#if __TRACE_THIS && 1
414 if (__inSQLDA) {
415 __DCL_TRACE2_N(L"__inSQLDA[%p] sqld[%d]]\n",
416 __inSQLDA, __inSQLDA->sqld);
417 ifx_sqlvar_t* sqlvar = __inSQLDA->sqlvar;
418 for (int2 i = 0; i < __inSQLDA->sqld; i++, sqlvar++) {
419 __DCL_TRACE3_N(L"[%10hs][%2d] sqllen[%4d]\n",
420 rtypname(sqlvar->sqltype), sqlvar->sqltype, sqlvar->sqllen);
421 }
422 }
423#endif
424
425/*
426 * EXEC SQL DESCRIBE OUTPUT :pszStatementID INTO __outSQLDA;
427 */
428#line 341 "ifxquery.ec"
429 {
430#line 341 "ifxquery.ec"
431 sqli_describe_output_stmt(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszStatementID, 257), &__outSQLDA, 0);
432#line 341 "ifxquery.ec"
433 }
434 if (SQLCODE < 0) {
435 __SET_ERROR_SQLCODE(SQLCODE);
436 return false;
437 }
438
439 __DCL_TRACE1_N(L"stmtType[%ls]\n",
440 __STMT_STRING(SQLCODE == 0 ? SQ_SELECT : SQLCODE));
441#if __USE_STMT_TYPE
442 __stmtType = sqlca.sqlcode;
443 if (__stmtType == 0)
444 __stmtType = SQ_SELECT;
445
446 switch (__stmtType) {
447 case SQ_SELECT:
448 case SQ_EXECPROC: {
449 break;
450 }
451 default: {
452 if (__outSQLDA) {
455 }
456 }
457 }
458#endif
459
460 if (__outSQLDA) {
461 __DCL_TRACE2_N(L"__outSQLDA[%p] sqld[%d]\n", __outSQLDA, __outSQLDA->sqld);
462 if (__outSQLDA->sqld > 0) {
463 if (!initFields())
464 return false;
465 }
466 }
467
468 if (_paramCount > 0) {
469 if (!initParams(_paramCount))
470 return false;
471 }
472
473 return true;
474}
#define NULL
Definition Config.h:340
#define __DCL_TRACE1_N(fmt, arg)
#define __DCL_TRACE2_N(fmt, arg1, arg2)
#define __DCL_TRACE3_N(fmt, arg1, arg2, arg3)
#define ndebug_free(_p)
Definition IFXUtils.h:23
bool initFields()
Definition IFXQuery.cpp:244
bool initParams(size_t _paramCount)
Definition IFXQuery.cpp:318

◆ initFields()

bool IFXQuery::initFields ( )
protected

Definition at line 244 of file IFXQuery.cpp.

245{
246 __DCL_ASSERT((Query::__fieldCount == 0)
247 && (__fields == NULL)
248 && (__outBuffer == NULL)
249 && (__outSQLDA != NULL)
250 && (__outSQLDA->sqld > 0));
251
252 Query::__fieldCount = __outSQLDA->sqld;
253 __fields = new IFXField[Query::__fieldCount];
254 if (__fields == NULL) {
256 return false;
257 }
258
259 mintptr offset = 0;
260 // 레코드 버퍼 크기 계산
261 ifx_sqlvar_t* sqlvar = __outSQLDA->sqlvar;
262 for(size_t i = 0; i < Query::__fieldCount; i++, sqlvar++) {
263 offset = rtypalign(offset, sqlvar->sqltype);
264 mint msize = rtypmsize(sqlvar->sqltype, sqlvar->sqllen);
265 __DCL_TRACE4_N(L"[%10hs] sqllen[%4d] msize[%4d] offset[%4d]\n",
266 rtypname(sqlvar->sqltype), sqlvar->sqllen,
267 msize, offset);
268 switch (sqlvar->sqltype & SQLTYPE) {
269 case SQLDECIMAL:
270 case SQLMONEY:
271 case SQLDTIME:
272 case SQLINTERVAL:
273 break;
274 default:
275 sqlvar->sqllen = msize;
276 }
277 offset += msize;
278 /*
279 SQLTYPE sqllen rtypmsize
280 ===========================================
281 SQLCHAR 서버컬럼최대길이 sqllen + 1
282 SQLVCHAR '\0'을 포함한 버퍼의 크기
283 SQLNCHAR
284 SQLNVCHAR
285 -------------------------------------------
286 SQLDECIMAL DECIMAL(p,s) sizeof(dec_t)
287 SQLMONEY 의 p,s의미
288 -------------------------------------------
289 SQLDTIME qualifier sizeof(dtime_t)
290 SQLINTERVAL qualifier sizeof(intrvl_t)
291 */
292 }
293
294 if (offset > 0) {
295 __outBuffer = (char*)malloc(offset);
296 __DCL_ASSERT((size_t)__outBuffer % sizeof(void*) == 0);
297 if (__outBuffer == NULL) {
299 return false;
300 }
301 memset(__outBuffer, 0, offset);
302 }
303
304 sqlvar = __outSQLDA->sqlvar;
305 offset = 0;
306 for(size_t i = 0; i < Query::__fieldCount; i++, sqlvar++) {
307 offset = rtypalign(offset, sqlvar->sqltype);
308 sqlvar->sqldata = (char*)__outBuffer + offset;
309 offset += rtypmsize(sqlvar->sqltype, sqlvar->sqllen);
310
311 if (!__fields[i].init(this, sqlvar))
312 return false;
313 }
314
315 return true;
316}
#define __DCL_TRACE4_N(fmt, arg1, arg2, arg3, arg4)
Definition IFXField.cpp:41
int mint
Definition IFXParam.cpp:11
#define __SET_ERROR(_errorCode)
Definition SQLCore.cpp:150
void * __outBuffer
Definition IFXQuery.h:35
@ eOutOfMemory
Definition SQLCore.h:24

◆ initParams()

bool IFXQuery::initParams ( size_t _paramCount)
protected

Definition at line 318 of file IFXQuery.cpp.

319{
321 && (Query::__paramCount == 0)
322 && (__inSQLDA != NULL));
323#if 0
324 size_t nAllocSize = sizeof(ifx_sqlda_t) + (sizeof(ifx_sqlvar_t) * _paramCount);
325 __inSQLDA = (ifx_sqlda_t*)malloc(nAllocSize);
326 if (__inSQLDA == NULL) {
328 return false;
329 }
330 memset(__inSQLDA, 0, nAllocSize);
331 __inSQLDA->sqld = _paramCount;
332 __inSQLDA->sqlvar = (ifx_sqlvar_t*)((char*)__inSQLDA + sizeof(ifx_sqlda_t));
333 __inSQLDA->desc_occ = sizeof(ifx_sqlda_t);
334#endif
335 Query::__paramCount = _paramCount;
336 __params = new IFXParam[Query::__paramCount];
337 if (__params == NULL) {
339 return false;
340 }
341
342 ifx_sqlvar_t* sqlvar = __inSQLDA->sqlvar;
343 for(size_t i = 0; i < Query::__paramCount; i++, sqlvar++) {
344 if (!__params[i].init(this, sqlvar))
345 return false;
346 }
347
348 return true;
349}

◆ reset()

bool IFXQuery::reset ( )
protected

Definition at line 122 of file IFXQuery.cpp.

123{
124/*
125 * EXEC SQL BEGIN DECLARE SECTION;
126 */
127#line 120 "ifxquery.ec"
128#line 121 "ifxquery.ec"
129 char *pszConnectionID = conn()->connectionID();
130 char *pszStatementID = (_CONST char*)__statementID.data();
131 char *pszCursorID = (_CONST char*)__cursorID.data();
132/*
133 * EXEC SQL END DECLARE SECTION;
134 */
135#line 124 "ifxquery.ec"
136
137
138/*
139 * EXEC SQL SET CONNECTION :pszConnectionID;
140 */
141#line 126 "ifxquery.ec"
142 {
143#line 126 "ifxquery.ec"
144 sqli_connect_set(0, pszConnectionID, 0);
145#line 126 "ifxquery.ec"
146 }
147 if (SQLCODE < 0) {
148 __SET_ERROR_SQLCODE(SQLCODE);
149 return false;
150 }
151 __DCL_ASSERT(SQLCODE == 0);
152
153 if (__cursorOpened) {
154/*
155 * EXEC SQL CLOSE :pszCursorID;
156 */
157#line 134 "ifxquery.ec"
158 {
159#line 134 "ifxquery.ec"
160 sqli_curs_close(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, pszCursorID, 256));
161#line 134 "ifxquery.ec"
162 }
163 __cursorOpened = false;
164 }
165
166 if (__cursorDeclared) {
167/*
168 * EXEC SQL FREE :pszCursorID;
169 */
170#line 139 "ifxquery.ec"
171 {
172#line 139 "ifxquery.ec"
173 sqli_mt_free(pszCursorID);
174#line 139 "ifxquery.ec"
175 }
176 __cursorDeclared = false;
177 }
178
179#if __USE_STMT_TYPE
180 if (__stmtType != __SQ_UNKNOWN) {
181/*
182 * EXEC SQL FREE :pszStatementID;
183 */
184#line 145 "ifxquery.ec"
185 {
186#line 145 "ifxquery.ec"
187 sqli_mt_free(pszStatementID);
188#line 145 "ifxquery.ec"
189 }
190 __stmtType = __SQ_UNKNOWN;
191 }
192#else
193 if (__outSQLDA || __inSQLDA) {
194/*
195 * EXEC SQL FREE : pszStatementID;
196 */
197#line 150 "ifxquery.ec"
198 {
199#line 150 "ifxquery.ec"
200 sqli_mt_free(pszStatementID);
201#line 150 "ifxquery.ec"
202 }
203 }
204#endif
205
206 Query::__eof = true;
207 Query::__affectedRows = -1;
208
209 // clear fields
210 if (__fields) {
211 __DCL_ASSERT(Query::__fieldCount > 0);
212 delete[] __fields;
213 __fields = NULL;
214 Query::__fieldCount = 0;
215 }
216
217 // clear binds
218 if (__params) {
219 __DCL_ASSERT(Query::__paramCount > 0);
220 delete[] __params;
221 __params = NULL;
222 Query::__paramCount = 0;
223 }
224
225 if (__outBuffer) {
226 free(__outBuffer);
228 }
229
230 if (__outSQLDA) {
231 // __outSQLDA는 Informix API에서 할당됨.
234 }
235
236 if (__inSQLDA) {
238 __inSQLDA = NULL;
239 }
240
241 return true;
242}
#define __SQ_UNKNOWN
Definition IFXQuery.h:10

Member Data Documentation

◆ __cursorDeclared

bool IFXQuery::__cursorDeclared
protected

Definition at line 37 of file IFXQuery.h.

◆ __cursorID

ByteString IFXQuery::__cursorID
protected

Definition at line 28 of file IFXQuery.h.

◆ __cursorOpened

bool IFXQuery::__cursorOpened
protected

Definition at line 38 of file IFXQuery.h.

◆ __fields

IFXField* IFXQuery::__fields
protected

Definition at line 41 of file IFXQuery.h.

◆ __inSQLDA

ifx_sqlda_t* IFXQuery::__inSQLDA
protected

Definition at line 33 of file IFXQuery.h.

◆ __outBuffer

void* IFXQuery::__outBuffer
protected

Definition at line 35 of file IFXQuery.h.

◆ __outSQLDA

ifx_sqlda_t* IFXQuery::__outSQLDA
protected

Definition at line 34 of file IFXQuery.h.

◆ __params

IFXParam* IFXQuery::__params
protected

Definition at line 40 of file IFXQuery.h.

◆ __statementID

ByteString IFXQuery::__statementID
protected

Definition at line 27 of file IFXQuery.h.


The documentation for this class was generated from the following files: