Skip to content

Commit e794b73

Browse files
committed
Merge PL/SQL Associative Array (Index-by) binds for NUMBER and STRING, thanks to @doberkofler
1 parent 936a1d6 commit e794b73

File tree

9 files changed

+1327
-157
lines changed

9 files changed

+1327
-157
lines changed

src/dpi/include/dpiStmt.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */
1+
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
All rights reserved. */
23

34
/******************************************************************************
45
*
@@ -181,7 +182,9 @@ class Stmt
181182
unsigned int bndpos,
182183
unsigned short type, void *buf, DPI_SZ_TYPE bufSize,
183184
short *ind, DPI_BUFLEN_TYPE *bufLen,
184-
void *data, cbtype cb = NULL ) = 0;
185+
unsigned int maxarr_len, unsigned int *curelen,
186+
void *data,
187+
cbtype cb = NULL ) = 0;
185188

186189
virtual void execute ( int numIterations, bool autoCommit = false) = 0;
187190

src/dpi/src/dpiStmtImpl.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */
1+
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
All rights reserved. */
23

34
/******************************************************************************
45
*
@@ -285,17 +286,24 @@ void StmtImpl::bind (unsigned int pos, unsigned short type, void *buf,
285286
PARAMETERS
286287
name - name of the variable
287288
nameLen - len of name.
289+
bndpos - position in array in case of DML Returning.
288290
type - data type
289291
buf (IN/OUT) - data buffer for value
290292
bufSize - size of buffer
291293
ind - indicator
292294
bufLen - returned buffer size
295+
maxarr_len - max array len in case of PL/SQL array binds
296+
curelen - current array len in case of PL/SQL array binds.
297+
data - if callback specified, data for callback
298+
cb - callback used in case of DML Returning.
293299
*/
294300
void StmtImpl::bind (const unsigned char *name, int nameLen,
295301
unsigned int bndpos,
296302
unsigned short type, void *buf, DPI_SZ_TYPE bufSize,
297303
short *ind, DPI_BUFLEN_TYPE *bufLen,
298-
void *data, cbtype cb)
304+
unsigned int maxarr_len, unsigned int *curelen,
305+
void *data,
306+
cbtype cb)
299307
{
300308
OCIBind *b = (OCIBind *)0;
301309

@@ -305,7 +313,8 @@ void StmtImpl::bind (const unsigned char *name, int nameLen,
305313
(type == DpiRSet) ? 0 : bufSize, type,
306314
(cb ? NULL : ind),
307315
(cb ? NULL : bufLen),
308-
NULL, 0, NULL,
316+
NULL,
317+
maxarr_len, curelen,
309318
(cb) ? OCI_DATA_AT_EXEC : OCI_DEFAULT), errh_);
310319
if ( cb )
311320
{

src/dpi/src/dpiStmtImpl.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */
1+
/* Copyright (c) 2015, 2016 Oracle and/or its affiliates.
2+
All rights reserved. */
23

34
/******************************************************************************
45
*
@@ -82,7 +83,9 @@ class StmtImpl : public Stmt
8283
unsigned int bndpos,
8384
unsigned short type, void *buf, DPI_SZ_TYPE bufSize,
8485
short *ind, DPI_BUFLEN_TYPE *bufLen,
85-
void *data, cbtype cb);
86+
unsigned int maxarr_len, unsigned int *curelen,
87+
void *data,
88+
cbtype cb);
8689

8790
virtual void execute ( int numIterations, bool autoCommit );
8891

0 commit comments

Comments
 (0)