@@ -60,28 +60,68 @@ describe('262. dbObjectOutBind.js', function() {
60
60
group by group_by;
61
61
end;` ;
62
62
let proc3 =
63
- `create or replace procedure nodb_getDataCursor3(
63
+ `create or replace procedure nodb_getDataCursor3(p_cur out sys_refcursor) is
64
+ begin
65
+ open p_cur for
66
+ select
67
+ rownum, substr('randomtext',1,rownum),
68
+ substr('randomtext',rownum)
69
+ from
70
+ dual
71
+ connect by level <= 10;
72
+ end;` ;
73
+ let proc4 =
74
+ `create or replace procedure nodb_getDataCursor4(p_cur out sys_refcursor) is
75
+ begin
76
+ open p_cur for
77
+ select
78
+ substr('sometext',level,1)
79
+ from
80
+ dual
81
+ connect by level <= 8;
82
+ end;` ;
83
+ let proc5 =
84
+ `create or replace procedure nodb_getDataCursor5(
64
85
p_cur1 out sys_refcursor,
65
86
p_cur2 out sys_refcursor
66
87
) is
67
88
begin
68
89
nodb_getDataCursor1(p_cur1);
69
90
nodb_getDataCursor2(p_cur2);
70
91
end;` ;
92
+ let proc6 =
93
+ `create or replace procedure nodb_getDataCursor6(
94
+ p_cur1 out sys_refcursor,
95
+ p_cur2 out sys_refcursor,
96
+ p_cur3 out sys_refcursor,
97
+ p_cur4 out sys_refcursor
98
+ ) is
99
+ begin
100
+ nodb_getDataCursor1(p_cur1);
101
+ nodb_getDataCursor2(p_cur2);
102
+ nodb_getDataCursor1(p_cur3);
103
+ nodb_getDataCursor2(p_cur4);
104
+ end;` ;
71
105
72
106
before ( async function ( ) {
73
107
try {
74
108
conn = await oracledb . getConnection ( dbConfig ) ;
75
109
await conn . execute ( proc1 ) ;
76
110
await conn . execute ( proc2 ) ;
77
111
await conn . execute ( proc3 ) ;
112
+ await conn . execute ( proc4 ) ;
113
+ await conn . execute ( proc5 ) ;
114
+ await conn . execute ( proc6 ) ;
78
115
} catch ( e ) {
79
116
assert . fail ( e ) ;
80
117
}
81
118
} ) ;
82
119
83
120
after ( async function ( ) {
84
121
try {
122
+ await conn . execute ( `DROP PROCEDURE nodb_getDataCursor6` ) ;
123
+ await conn . execute ( `DROP PROCEDURE nodb_getDataCursor5` ) ;
124
+ await conn . execute ( `DROP PROCEDURE nodb_getDataCursor4` ) ;
85
125
await conn . execute ( `DROP PROCEDURE nodb_getDataCursor3` ) ;
86
126
await conn . execute ( `DROP PROCEDURE nodb_getDataCursor2` ) ;
87
127
await conn . execute ( `DROP PROCEDURE nodb_getDataCursor1` ) ;
@@ -94,7 +134,7 @@ describe('262. dbObjectOutBind.js', function() {
94
134
it ( '262.1 call procedure with 2 OUT binds of DbObject' , async function ( ) {
95
135
try {
96
136
let result = await conn . execute (
97
- `BEGIN nodb_getDataCursor3 (p_cur1 => :p_cur1,
137
+ `BEGIN nodb_getDataCursor5 (p_cur1 => :p_cur1,
98
138
p_cur2 => :p_cur2); end;` ,
99
139
{
100
140
p_cur1 : { type : oracledb . CURSOR , dir : oracledb . BIND_OUT } ,
@@ -108,5 +148,36 @@ describe('262. dbObjectOutBind.js', function() {
108
148
}
109
149
} ) ;
110
150
151
+ it ( '262.2 call procedure with multiple OUT binds of DbObject' , async function ( ) {
152
+ try {
153
+ let result = await conn . execute (
154
+ `BEGIN nodb_getDataCursor6(p_cur1 => :p_cur1,
155
+ p_cur2 => :p_cur2, p_cur3 => :p_cur3, p_cur4 => :p_cur4); end;` ,
156
+ {
157
+ p_cur1 : { type : oracledb . CURSOR , dir : oracledb . BIND_OUT } ,
158
+ p_cur2 : { type : oracledb . CURSOR , dir : oracledb . BIND_OUT } ,
159
+ p_cur3 : { type : oracledb . CURSOR , dir : oracledb . BIND_OUT } ,
160
+ p_cur4 : { type : oracledb . CURSOR , dir : oracledb . BIND_OUT }
161
+ }
162
+ ) ;
163
+ let resultSet = await result . outBinds . p_cur1 . getRows ( ) ;
164
+ assert . equal ( resultSet . length , 9 ) ;
165
+ result . outBinds . p_cur1 . close ( ) ;
166
+
167
+ resultSet = await result . outBinds . p_cur2 . getRows ( ) ;
168
+ assert . equal ( resultSet . length , 3 ) ;
169
+ result . outBinds . p_cur2 . close ( ) ;
170
+
171
+ resultSet = await result . outBinds . p_cur3 . getRows ( ) ;
172
+ assert . equal ( resultSet . length , 9 ) ;
173
+ result . outBinds . p_cur3 . close ( ) ;
174
+
175
+ resultSet = await result . outBinds . p_cur4 . getRows ( ) ;
176
+ assert . equal ( resultSet . length , 3 ) ;
177
+ result . outBinds . p_cur4 . close ( ) ;
178
+ } catch ( e ) {
179
+ assert . fail ( e ) ;
180
+ }
181
+ } ) ;
111
182
} ) ;
112
183
0 commit comments