@@ -3324,6 +3324,17 @@ void Connection::DoDefines ( eBaton* executeBaton )
3324
3324
executeBaton->extDefines [col] = new ExtDefine (
3325
3325
NJS_EXTDEFINE_CLOBASSTR ) ;
3326
3326
executeBaton->extDefines [col]->fields .extClobAsStr .ctx = (void *) ctx;
3327
+
3328
+ executeBaton->extDefines [col]->fields .extClobAsStr .len2 =
3329
+ ( unsigned int * ) malloc ( sizeof ( unsigned int ) *
3330
+ executeBaton->maxRows );
3331
+ if ( !executeBaton->extDefines [col]->fields .extClobAsStr .len2 )
3332
+ {
3333
+ executeBaton->error = NJSMessages::getErrorMsg (
3334
+ errInsufficientMemory );
3335
+ error = true ;
3336
+ }
3337
+
3327
3338
}
3328
3339
else
3329
3340
{
@@ -3369,6 +3380,8 @@ void Connection::DoFetch (eBaton* executeBaton)
3369
3380
*/
3370
3381
for ( unsigned int row = 0 ; row < executeBaton->rowsFetched ; row ++ )
3371
3382
{
3383
+ define->len [row] = ( DPI_BUFLEN_TYPE )
3384
+ extDefine->fields .extClobAsStr .len2 [row];
3372
3385
define->len [row] += extDefine->fields .extClobAsStr .cLen ;
3373
3386
}
3374
3387
}
@@ -5579,8 +5592,8 @@ int Connection::cbDynBufferGet ( void *ctx, DPI_SZ_TYPE nRows,
5579
5592
initialized.
5580
5593
*/
5581
5594
int Connection::cbDynDefine ( void *octxp, unsigned long definePos,
5582
- unsigned long iter, unsigned long *prevIter,
5583
- void **bufpp, unsigned long **alenpp,
5595
+ unsigned int iter, unsigned long *prevIter,
5596
+ void **bufpp, unsigned int **alenpp,
5584
5597
void **indpp, unsigned short **rcodepp )
5585
5598
{
5586
5599
eBaton *executeBaton = (eBaton *) octxp ;
@@ -5618,11 +5631,14 @@ int Connection::cbDynDefine ( void *octxp, unsigned long definePos,
5618
5631
}
5619
5632
else
5620
5633
{
5621
- define-> len [iter] = maxLen;
5634
+ extDefine-> fields . extClobAsStr . len2 [iter] = maxLen;
5622
5635
define->ind [iter] = 0 ; // default value for indicator
5623
5636
5624
5637
*bufpp = (void *) (&buf[iter][extDefine->fields .extClobAsStr .cLen ]);
5625
- *alenpp = (unsigned long *) &(define->len [iter]) ; // size for this iter
5638
+
5639
+ // size for this iter
5640
+ *alenpp = (unsigned int *) &(extDefine->fields .extClobAsStr .len2 [iter]) ;
5641
+
5626
5642
*indpp = (void *) &(define->ind [iter]); // indicator
5627
5643
}
5628
5644
return ret ;
0 commit comments