Skip to content
Navigation Menu
{{ message }}
forked from opensearch-project/sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbind.c
More file actions
687 lines (596 loc) · 21.1 KB
/
Copy pathbind.c
File metadata and controls
687 lines (596 loc) · 21.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
#include "bind.h"
#include <ctype.h>
#include <string.h>
#include "descriptor.h"
#include "environ.h"
#include "misc.h"
#include "multibyte.h"
#include "opensearch_apifunc.h"
#include "opensearch_types.h"
#include "qresult.h"
#include "statement.h"
/* Associate a user-supplied buffer with a database column. */
RETCODE SQL_API OPENSEARCHAPI_BindCol(HSTMT hstmt, SQLUSMALLINT icol,
SQLSMALLINT fCType, PTR rgbValue,
SQLLEN cbValueMax, SQLLEN *pcbValue) {
StatementClass *stmt = (StatementClass *)hstmt;
CSTR func = "OPENSEARCHAPI_BindCol";
ARDFields *opts;
GetDataInfo *gdata_info;
BindInfoClass *bookmark;
RETCODE ret = SQL_SUCCESS;
MYLOG(OPENSEARCH_TRACE, "entering...\n");
MYLOG(OPENSEARCH_DEBUG, "**** : stmt = %p, icol = %d\n", stmt, icol);
MYLOG(OPENSEARCH_DEBUG, "**** : fCType=%d rgb=%p valusMax=" FORMAT_LEN " pcb=%p\n",
fCType, rgbValue, cbValueMax, pcbValue);
if (!stmt) {
SC_log_error(func, "", NULL);
return SQL_INVALID_HANDLE;
}
opts = SC_get_ARDF(stmt);
if (stmt->status == STMT_EXECUTING) {
SC_set_error(stmt, STMT_SEQUENCE_ERROR,
"Can't bind columns while statement is still executing.",
func);
return SQL_ERROR;
}
#ifdef __APPLE__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#endif // __APPLE__
#define return DONT_CALL_RETURN_FROM_HERE ? ? ?
#ifdef __APPLE__
#pragma clang diagnostic pop
#endif // __APPLE__
SC_clear_error(stmt);
/* If the bookmark column is being bound, then just save it */
if (icol == 0) {
bookmark = opts->bookmark;
if (rgbValue == NULL) {
if (bookmark) {
bookmark->buffer = NULL;
bookmark->used = bookmark->indicator = NULL;
}
} else {
/* Make sure it is the bookmark data type */
switch (fCType) {
case SQL_C_BOOKMARK:
case SQL_C_VARBOOKMARK:
break;
default:
SC_set_error(stmt, STMT_PROGRAM_TYPE_OUT_OF_RANGE,
"Bind column 0 is not of type SQL_C_BOOKMARK",
func);
MYLOG(
OPENSEARCH_ERROR,
"Bind column 0 is type %d not of type SQL_C_BOOKMARK\n",
fCType);
ret = SQL_ERROR;
goto cleanup;
}
bookmark = ARD_AllocBookmark(opts);
bookmark->buffer = rgbValue;
bookmark->used = bookmark->indicator = pcbValue;
bookmark->buflen = cbValueMax;
bookmark->returntype = fCType;
}
goto cleanup;
}
/*
* Allocate enough bindings if not already done. Most likely,
* execution of a statement would have setup the necessary bindings.
* But some apps call BindCol before any statement is executed.
*/
if (icol > opts->allocated)
extend_column_bindings(opts, icol);
gdata_info = SC_get_GDTI(stmt);
if (icol > gdata_info->allocated)
extend_getdata_info(gdata_info, icol, FALSE);
/* check to see if the bindings were allocated */
if (!opts->bindings || !gdata_info->gdata) {
SC_set_error(stmt, STMT_NO_MEMORY_ERROR,
"Could not allocate memory for bindings.", func);
ret = SQL_ERROR;
goto cleanup;
}
/* use zero based col numbers from here out */
icol--;
/* Reset for SQLGetData */
GETDATA_RESET(gdata_info->gdata[icol]);
if (rgbValue == NULL) {
/* we have to unbind the column */
opts->bindings[icol].buflen = 0;
opts->bindings[icol].buffer = NULL;
opts->bindings[icol].used = opts->bindings[icol].indicator = NULL;
opts->bindings[icol].returntype = SQL_C_CHAR;
opts->bindings[icol].precision = 0;
opts->bindings[icol].scale = 0;
if (gdata_info->gdata[icol].ttlbuf)
free(gdata_info->gdata[icol].ttlbuf);
gdata_info->gdata[icol].ttlbuf = NULL;
gdata_info->gdata[icol].ttlbuflen = 0;
gdata_info->gdata[icol].ttlbufused = 0;
} else {
/* ok, bind that column */
opts->bindings[icol].buflen = cbValueMax;
opts->bindings[icol].buffer = rgbValue;
opts->bindings[icol].used = opts->bindings[icol].indicator = pcbValue;
opts->bindings[icol].returntype = fCType;
opts->bindings[icol].precision = 0;
switch (fCType) {
case SQL_C_NUMERIC:
opts->bindings[icol].precision = 32;
break;
case SQL_C_TIMESTAMP:
case SQL_C_INTERVAL_DAY_TO_SECOND:
case SQL_C_INTERVAL_HOUR_TO_SECOND:
case SQL_C_INTERVAL_MINUTE_TO_SECOND:
case SQL_C_INTERVAL_SECOND:
opts->bindings[icol].precision = 6;
break;
}
opts->bindings[icol].scale = 0;
MYLOG(OPENSEARCH_DEBUG, " bound buffer[%d] = %p\n", icol,
opts->bindings[icol].buffer);
}
cleanup:
#undef return
return ret;
}
RETCODE SQL_API OPENSEARCHAPI_NumParams(HSTMT hstmt, SQLSMALLINT *pcpar) {
StatementClass *stmt = (StatementClass *)hstmt;
if (pcpar != NULL) {
*pcpar = 0;
} else {
SC_set_error(stmt, STMT_EXEC_ERROR, "Parameter count address is null",
"OPENSEARCHAPI_NumParams");
return SQL_ERROR;
}
return SQL_SUCCESS;
}
/*
* Bindings Implementation
*/
static BindInfoClass *create_empty_bindings(int num_columns) {
BindInfoClass *new_bindings;
int i;
new_bindings = (BindInfoClass *)malloc(num_columns * sizeof(BindInfoClass));
if (!new_bindings)
return NULL;
for (i = 0; i < num_columns; i++) {
new_bindings[i].buflen = 0;
new_bindings[i].buffer = NULL;
new_bindings[i].used = new_bindings[i].indicator = NULL;
}
return new_bindings;
}
void extend_parameter_bindings(APDFields *self, SQLSMALLINT num_params) {
ParameterInfoClass *new_bindings;
MYLOG(OPENSEARCH_TRACE,
"entering ... self=%p, parameters_allocated=%d, num_params=%d,%p\n",
self, self->allocated, num_params, self->parameters);
/*
* if we have too few, allocate room for more, and copy the old
* entries into the new structure
*/
if (self->allocated < num_params) {
new_bindings = (ParameterInfoClass *)realloc(
self->parameters, sizeof(ParameterInfoClass) * num_params);
if (!new_bindings) {
MYLOG(OPENSEARCH_DEBUG,
"unable to create %d new bindings from %d old bindings\n",
num_params, self->allocated);
if (self->parameters)
free(self->parameters);
self->parameters = NULL;
self->allocated = 0;
return;
}
memset(&new_bindings[self->allocated], 0,
sizeof(ParameterInfoClass) * (num_params - self->allocated));
self->parameters = new_bindings;
self->allocated = num_params;
}
MYLOG(OPENSEARCH_TRACE, "leaving %p\n", self->parameters);
}
void extend_iparameter_bindings(IPDFields *self, SQLSMALLINT num_params) {
ParameterImplClass *new_bindings;
MYLOG(OPENSEARCH_TRACE,
"entering ... self=%p, parameters_allocated=%d, num_params=%d\n",
self, self->allocated, num_params);
/*
* if we have too few, allocate room for more, and copy the old
* entries into the new structure
*/
if (self->allocated < num_params) {
new_bindings = (ParameterImplClass *)realloc(
self->parameters, sizeof(ParameterImplClass) * num_params);
if (!new_bindings) {
MYLOG(OPENSEARCH_DEBUG,
"unable to create %d new bindings from %d old bindings\n",
num_params, self->allocated);
if (self->parameters)
free(self->parameters);
self->parameters = NULL;
self->allocated = 0;
return;
}
memset(&new_bindings[self->allocated], 0,
sizeof(ParameterImplClass) * (num_params - self->allocated));
self->parameters = new_bindings;
self->allocated = num_params;
}
MYLOG(OPENSEARCH_TRACE, "leaving %p\n", self->parameters);
}
void reset_a_parameter_binding(APDFields *self, int ipar) {
MYLOG(OPENSEARCH_TRACE, "entering ... self=%p, parameters_allocated=%d, ipar=%d\n",
self, self->allocated, ipar);
if (ipar < 1 || ipar > self->allocated)
return;
ipar--;
self->parameters[ipar].buflen = 0;
self->parameters[ipar].buffer = NULL;
self->parameters[ipar].used = self->parameters[ipar].indicator = NULL;
self->parameters[ipar].CType = 0;
self->parameters[ipar].data_at_exec = FALSE;
self->parameters[ipar].precision = 0;
self->parameters[ipar].scale = 0;
}
void reset_a_iparameter_binding(IPDFields *self, int ipar) {
MYLOG(OPENSEARCH_TRACE, "entering ... self=%p, parameters_allocated=%d, ipar=%d\n",
self, self->allocated, ipar);
if (ipar < 1 || ipar > self->allocated)
return;
ipar--;
NULL_THE_NAME(self->parameters[ipar].paramName);
self->parameters[ipar].paramType = 0;
self->parameters[ipar].SQLType = 0;
self->parameters[ipar].column_size = 0;
self->parameters[ipar].decimal_digits = 0;
self->parameters[ipar].precision = 0;
self->parameters[ipar].scale = 0;
PIC_set_opensearch_type(self->parameters[ipar], 0);
}
int CountParameters(const StatementClass *self, Int2 *inputCount, Int2 *ioCount,
Int2 *outputCount) {
IPDFields *ipdopts = SC_get_IPDF(self);
int i, num_params, valid_count;
if (inputCount)
*inputCount = 0;
if (ioCount)
*ioCount = 0;
if (outputCount)
*outputCount = 0;
if (!ipdopts)
return -1;
num_params = self->num_params;
if (ipdopts->allocated < num_params)
num_params = ipdopts->allocated;
for (i = 0, valid_count = 0; i < num_params; i++) {
if (SQL_PARAM_OUTPUT == ipdopts->parameters[i].paramType) {
if (outputCount) {
(*outputCount)++;
valid_count++;
}
} else if (SQL_PARAM_INPUT_OUTPUT == ipdopts->parameters[i].paramType) {
if (ioCount) {
(*ioCount)++;
valid_count++;
}
} else if (inputCount) {
(*inputCount)++;
valid_count++;
}
}
return valid_count;
}
/*
* Free parameters and free the memory.
*/
void APD_free_params(APDFields *apdopts, char option) {
MYLOG(OPENSEARCH_TRACE, "entering self=%p\n", apdopts);
if (!apdopts->parameters)
return;
if (option == STMT_FREE_PARAMS_ALL) {
free(apdopts->parameters);
apdopts->parameters = NULL;
apdopts->allocated = 0;
}
MYLOG(OPENSEARCH_TRACE, "leaving\n");
}
void PDATA_free_params(PutDataInfo *pdata, char option) {
int i;
MYLOG(OPENSEARCH_TRACE, "entering self=%p\n", pdata);
if (!pdata->pdata)
return;
for (i = 0; i < pdata->allocated; i++) {
if (pdata->pdata[i].EXEC_used) {
free(pdata->pdata[i].EXEC_used);
pdata->pdata[i].EXEC_used = NULL;
}
if (pdata->pdata[i].EXEC_buffer) {
free(pdata->pdata[i].EXEC_buffer);
pdata->pdata[i].EXEC_buffer = NULL;
}
}
if (option == STMT_FREE_PARAMS_ALL) {
free(pdata->pdata);
pdata->pdata = NULL;
pdata->allocated = 0;
}
MYLOG(OPENSEARCH_TRACE, "leaving\n");
}
/*
* Free parameters and free the memory.
*/
void IPD_free_params(IPDFields *ipdopts, char option) {
MYLOG(OPENSEARCH_TRACE, "entering self=%p\n", ipdopts);
if (!ipdopts->parameters)
return;
if (option == STMT_FREE_PARAMS_ALL) {
free(ipdopts->parameters);
ipdopts->parameters = NULL;
ipdopts->allocated = 0;
}
MYLOG(OPENSEARCH_TRACE, "leaving\n");
}
void extend_column_bindings(ARDFields *self, SQLSMALLINT num_columns) {
BindInfoClass *new_bindings;
SQLSMALLINT i;
MYLOG(OPENSEARCH_TRACE,
"entering ... self=%p, bindings_allocated=%d, num_columns=%d\n", self,
self->allocated, num_columns);
/*
* if we have too few, allocate room for more, and copy the old
* entries into the new structure
*/
if (self->allocated < num_columns) {
new_bindings = create_empty_bindings(num_columns);
if (!new_bindings) {
MYLOG(OPENSEARCH_DEBUG,
"unable to create %d new bindings from %d old bindings\n",
num_columns, self->allocated);
if (self->bindings) {
free(self->bindings);
self->bindings = NULL;
}
self->allocated = 0;
return;
}
if (self->bindings) {
for (i = 0; i < self->allocated; i++)
new_bindings[i] = self->bindings[i];
free(self->bindings);
}
self->bindings = new_bindings;
self->allocated = num_columns;
}
/*
* There is no reason to zero out extra bindings if there are more
* than needed. If an app has allocated extra bindings, let it worry
* about it by unbinding those columns.
*/
/* SQLBindCol(1..) ... SQLBindCol(10...) # got 10 bindings */
/* SQLExecDirect(...) # returns 5 cols */
/* SQLExecDirect(...) # returns 10 cols (now OK) */
MYLOG(OPENSEARCH_TRACE, "leaving %p\n", self->bindings);
}
void reset_a_column_binding(ARDFields *self, int icol) {
BindInfoClass *bookmark;
MYLOG(OPENSEARCH_TRACE, "entering ... self=%p, bindings_allocated=%d, icol=%d\n",
self, self->allocated, icol);
if (icol > self->allocated)
return;
/* use zero based col numbers from here out */
if (0 == icol) {
if (bookmark = self->bookmark, bookmark != NULL) {
bookmark->buffer = NULL;
bookmark->used = bookmark->indicator = NULL;
}
} else {
icol--;
/* we have to unbind the column */
self->bindings[icol].buflen = 0;
self->bindings[icol].buffer = NULL;
self->bindings[icol].used = self->bindings[icol].indicator = NULL;
self->bindings[icol].returntype = SQL_C_CHAR;
}
}
void ARD_unbind_cols(ARDFields *self, BOOL freeall) {
Int2 lf;
MYLOG(OPENSEARCH_ALL, "freeall=%d allocated=%d bindings=%p\n", freeall,
self->allocated, self->bindings);
for (lf = 1; lf <= self->allocated; lf++)
reset_a_column_binding(self, lf);
if (freeall) {
if (self->bindings)
free(self->bindings);
self->bindings = NULL;
self->allocated = 0;
}
}
void GDATA_unbind_cols(GetDataInfo *self, BOOL freeall) {
Int2 lf;
MYLOG(OPENSEARCH_ALL, "freeall=%d allocated=%d gdata=%p\n", freeall,
self->allocated, self->gdata);
if (self->fdata.ttlbuf) {
free(self->fdata.ttlbuf);
self->fdata.ttlbuf = NULL;
}
self->fdata.ttlbuflen = self->fdata.ttlbufused = 0;
GETDATA_RESET(self->fdata);
for (lf = 1; lf <= self->allocated; lf++)
reset_a_getdata_info(self, lf);
if (freeall) {
if (self->gdata)
free(self->gdata);
self->gdata = NULL;
self->allocated = 0;
}
}
void GetDataInfoInitialize(GetDataInfo *gdata_info) {
GETDATA_RESET(gdata_info->fdata);
gdata_info->fdata.ttlbuf = NULL;
gdata_info->fdata.ttlbuflen = gdata_info->fdata.ttlbufused = 0;
gdata_info->allocated = 0;
gdata_info->gdata = NULL;
}
static GetDataClass *create_empty_gdata(int num_columns) {
GetDataClass *new_gdata;
int i;
new_gdata = (GetDataClass *)malloc(num_columns * sizeof(GetDataClass));
if (!new_gdata)
return NULL;
for (i = 0; i < num_columns; i++) {
GETDATA_RESET(new_gdata[i]);
new_gdata[i].ttlbuf = NULL;
new_gdata[i].ttlbuflen = 0;
new_gdata[i].ttlbufused = 0;
}
return new_gdata;
}
void extend_getdata_info(GetDataInfo *self, SQLSMALLINT num_columns,
BOOL shrink) {
GetDataClass *new_gdata;
MYLOG(OPENSEARCH_TRACE,
"entering ... self=%p, gdata_allocated=%d, num_columns=%d\n", self,
self->allocated, num_columns);
/*
* if we have too few, allocate room for more, and copy the old
* entries into the new structure
*/
if (self->allocated < num_columns) {
new_gdata = create_empty_gdata(num_columns);
if (!new_gdata) {
MYLOG(OPENSEARCH_DEBUG, "unable to create %d new gdata from %d old gdata\n",
num_columns, self->allocated);
if (self->gdata) {
free(self->gdata);
self->gdata = NULL;
}
self->allocated = 0;
return;
}
if (self->gdata) {
SQLSMALLINT i;
for (i = 0; i < self->allocated; i++)
new_gdata[i] = self->gdata[i];
free(self->gdata);
}
self->gdata = new_gdata;
self->allocated = num_columns;
} else if (shrink && self->allocated > num_columns) {
int i;
for (i = self->allocated; i > num_columns; i--)
reset_a_getdata_info(self, i);
self->allocated = num_columns;
if (0 == num_columns) {
free(self->gdata);
self->gdata = NULL;
}
}
/*
* There is no reason to zero out extra gdata if there are more
* than needed. If an app has allocated extra gdata, let it worry
* about it by unbinding those columns.
*/
MYLOG(OPENSEARCH_TRACE, "leaving %p\n", self->gdata);
}
void reset_a_getdata_info(GetDataInfo *gdata_info, int icol) {
if (icol < 1 || icol > gdata_info->allocated)
return;
icol--;
if (gdata_info->gdata[icol].ttlbuf) {
free(gdata_info->gdata[icol].ttlbuf);
gdata_info->gdata[icol].ttlbuf = NULL;
}
gdata_info->gdata[icol].ttlbuflen = gdata_info->gdata[icol].ttlbufused = 0;
GETDATA_RESET(gdata_info->gdata[icol]);
}
void PutDataInfoInitialize(PutDataInfo *pdata_info) {
pdata_info->allocated = 0;
pdata_info->pdata = NULL;
}
void extend_putdata_info(PutDataInfo *self, SQLSMALLINT num_params,
BOOL shrink) {
PutDataClass *new_pdata;
MYLOG(OPENSEARCH_TRACE,
"entering ... self=%p, parameters_allocated=%d, num_params=%d\n",
self, self->allocated, num_params);
/*
* if we have too few, allocate room for more, and copy the old
* entries into the new structure
*/
if (self->allocated < num_params) {
if (self->allocated <= 0 && self->pdata) {
MYLOG(OPENSEARCH_DEBUG, "??? pdata is not null while allocated == 0\n");
self->pdata = NULL;
}
new_pdata = (PutDataClass *)realloc(self->pdata,
sizeof(PutDataClass) * num_params);
if (!new_pdata) {
MYLOG(OPENSEARCH_DEBUG, "unable to create %d new pdata from %d old pdata\n",
num_params, self->allocated);
self->pdata = NULL;
self->allocated = 0;
return;
}
memset(&new_pdata[self->allocated], 0,
sizeof(PutDataClass) * (num_params - self->allocated));
self->pdata = new_pdata;
self->allocated = num_params;
} else if (shrink && self->allocated > num_params) {
int i;
for (i = self->allocated; i > num_params; i--)
reset_a_putdata_info(self, i);
self->allocated = num_params;
if (0 == num_params) {
free(self->pdata);
self->pdata = NULL;
}
}
MYLOG(OPENSEARCH_TRACE, "leaving %p\n", self->pdata);
}
void reset_a_putdata_info(PutDataInfo *pdata_info, int ipar) {
if (ipar < 1 || ipar > pdata_info->allocated)
return;
ipar--;
if (pdata_info->pdata[ipar].EXEC_used) {
free(pdata_info->pdata[ipar].EXEC_used);
pdata_info->pdata[ipar].EXEC_used = NULL;
}
if (pdata_info->pdata[ipar].EXEC_buffer) {
free(pdata_info->pdata[ipar].EXEC_buffer);
pdata_info->pdata[ipar].EXEC_buffer = NULL;
}
pdata_info->pdata[ipar].lobj_oid = 0;
}
void SC_param_next(const StatementClass *stmt, int *param_number,
ParameterInfoClass **apara, ParameterImplClass **ipara) {
int next;
IPDFields *ipdopts = SC_get_IPDF(stmt);
if (*param_number < 0)
next = stmt->proc_return;
else
next = *param_number + 1;
if (stmt->discard_output_params) {
for (; next < ipdopts->allocated
&& SQL_PARAM_OUTPUT == ipdopts->parameters[next].paramType;
next++)
;
}
*param_number = next;
if (ipara) {
if (next < ipdopts->allocated)
*ipara = ipdopts->parameters + next;
else
*ipara = NULL;
}
if (apara) {
APDFields *apdopts = SC_get_APDF(stmt);
if (next < apdopts->allocated)
*apara = apdopts->parameters + next;
else
*apara = NULL;
}
}
You can’t perform that action at this time.
