@@ -539,7 +539,7 @@ describe('44. plsqlBinding2.js', function() {
539
539
] , done ) ;
540
540
} ) // 44.5
541
541
542
- it ( '44.6 NJS-039: empty array is not allowed for IN bind ' , function ( done ) {
542
+ it ( '44.6 empty array for BIND_IN and BIND_INOUT ' , function ( done ) {
543
543
async . series ( [
544
544
// Pass arrays of values to a PL/SQL procedure
545
545
function ( callback ) {
@@ -557,6 +557,7 @@ describe('44. plsqlBinding2.js', function() {
557
557
function ( err ) {
558
558
should . exist ( err ) ;
559
559
( err . message ) . should . startWith ( 'NJS-039' ) ;
560
+ // NJS-039: empty array is not allowed for IN bind
560
561
callback ( ) ;
561
562
}
562
563
) ;
@@ -569,6 +570,7 @@ describe('44. plsqlBinding2.js', function() {
569
570
beach_inout : { type : oracledb . STRING ,
570
571
dir : oracledb . BIND_INOUT ,
571
572
val : [ ] ,
573
+ maxArraySize : 0
572
574
} ,
573
575
depth_inout : { type : oracledb . NUMBER ,
574
576
dir : oracledb . BIND_INOUT ,
@@ -585,7 +587,63 @@ describe('44. plsqlBinding2.js', function() {
585
587
] , done ) ;
586
588
} ) // 44.6
587
589
588
- it . skip ( '44.7 maxSize option applies to each elements of an array' , function ( done ) {
590
+ it ( '44.7 empty array for BIND_OUT' , function ( done ) {
591
+ async . series ( [
592
+ function ( callback ) {
593
+ var proc = "CREATE OR REPLACE PACKAGE\n" +
594
+ "oracledb_testpack\n" +
595
+ "IS\n" +
596
+ " TYPE stringsType IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER;\n" +
597
+ " PROCEDURE test(p OUT stringsType);\n" +
598
+ "END;" ;
599
+ connection . execute (
600
+ proc ,
601
+ function ( err ) {
602
+ should . not . exist ( err ) ;
603
+ callback ( ) ;
604
+ }
605
+ ) ;
606
+ } ,
607
+ function ( callback ) {
608
+ var proc = "CREATE OR REPLACE PACKAGE BODY\n" +
609
+ "oracledb_testpack\n" +
610
+ "IS\n" +
611
+ " PROCEDURE test(p OUT stringsType) IS BEGIN NULL; END;\n" +
612
+ "END;" ;
613
+ connection . execute (
614
+ proc ,
615
+ function ( err ) {
616
+ should . not . exist ( err ) ;
617
+ callback ( ) ;
618
+ }
619
+ ) ;
620
+ } ,
621
+ function ( callback ) {
622
+ connection . execute (
623
+ "BEGIN oracledb_testpack.test(:0); END;" ,
624
+ [
625
+ { type : oracledb . STRING , dir : oracledb . BIND_OUT , maxArraySize : 1 }
626
+ ] ,
627
+ function ( err , result ) {
628
+ should . not . exist ( err ) ;
629
+ result . outBinds [ 0 ] . should . eql ( [ ] ) ;
630
+ callback ( ) ;
631
+ }
632
+ ) ;
633
+ } ,
634
+ function ( callback ) {
635
+ connection . execute (
636
+ "DROP PACKAGE oracledb_testpack" ,
637
+ function ( err ) {
638
+ should . not . exist ( err ) ;
639
+ callback ( ) ;
640
+ }
641
+ ) ;
642
+ }
643
+ ] , done ) ;
644
+ } ) // 44.7
645
+
646
+ it . skip ( '44.8 maxSize option applies to each elements of an array' , function ( done ) {
589
647
async . series ( [
590
648
// Pass arrays of values to a PL/SQL procedure
591
649
function ( callback ) {
@@ -658,7 +716,6 @@ describe('44. plsqlBinding2.js', function() {
658
716
) ;
659
717
}
660
718
] , done ) ;
661
- } ) // 44.7
662
-
719
+ } ) // 44.8
663
720
664
721
} )
0 commit comments