@@ -424,6 +424,75 @@ describe("72. lobBind2.js", function() {
424
424
425
425
} ) ; // 72.1.6
426
426
427
+ it ( "72.1.7 Negative - BIND_INOUT, PL/SQL" , function ( done ) {
428
+
429
+ var seq = 7 ;
430
+ var outStr = "This is a out bind string." ;
431
+ var proc = "CREATE OR REPLACE PROCEDURE nodb_proc_clob_inout1 \n" +
432
+ " (p_num IN NUMBER, p_inout IN OUT CLOB) \n" +
433
+ "AS \n" +
434
+ "BEGIN \n" +
435
+ " insert into nodb_tab_clob72 (id, content) values (p_num, p_inout); \n" +
436
+ " select to_clob('" + outStr + "') into p_inout from dual; \n" +
437
+ "END nodb_proc_clob_inout1;" ;
438
+
439
+ async . series ( [
440
+ function ( cb ) {
441
+ executeSQL ( proc , cb ) ;
442
+ } ,
443
+ function ( cb ) {
444
+ connection . createLob ( oracledb . CLOB , function ( err , lob ) {
445
+ should . not . exist ( err ) ;
446
+
447
+ lob . on ( "close" , function ( err ) {
448
+ should . not . exist ( err ) ;
449
+
450
+ connection . commit ( function ( err ) {
451
+ should . not . exist ( err ) ;
452
+
453
+ return cb ( ) ;
454
+ } ) ;
455
+ } ) ; // close event
456
+
457
+ lob . on ( "error" , function ( err ) {
458
+ should . not . exist ( err , "lob.on 'error' event." ) ;
459
+ } ) ;
460
+
461
+ lob . on ( "finish" , function ( ) {
462
+ connection . execute (
463
+ "begin nodb_proc_clob_inout1(:id, :io); end;" ,
464
+ {
465
+ id : seq ,
466
+ io : { type : oracledb . CLOB , dir : oracledb . BIND_INOUT , val : lob }
467
+ } ,
468
+ function ( err ) {
469
+ should . exist ( err ) ;
470
+ ( err . message ) . should . startWith ( "NJS-049:" ) ;
471
+ // NJS-049: cannot use bind direction IN OUT for temporary LOBs
472
+ lob . close ( function ( err ) {
473
+ should . not . exist ( err ) ;
474
+ } ) ;
475
+ }
476
+ ) ;
477
+ } ) ; // finish event
478
+
479
+ var inStream = fs . createReadStream ( inFileName ) ;
480
+
481
+ inStream . on ( "error" , function ( err ) {
482
+ should . not . exist ( err , "inStream.on 'error' event." ) ;
483
+ } ) ;
484
+
485
+ inStream . pipe ( lob ) ;
486
+ } ) ;
487
+
488
+ } ,
489
+ function ( cb ) {
490
+ var sql = "DROP PROCEDURE nodb_proc_clob_inout1" ;
491
+ executeSQL ( sql , cb ) ;
492
+ }
493
+ ] , done ) ;
494
+ } ) ; // 72.1.7
495
+
427
496
} ) ; // 72.1
428
497
429
498
describe ( "72.2 BLOB" , function ( ) {
0 commit comments