1
- /* Copyright (c) 2015, 2019 , Oracle and/or its affiliates. All rights reserved. */
1
+ /* Copyright (c) 2015, 2020 , Oracle and/or its affiliates. All rights reserved. */
2
2
3
3
/******************************************************************************
4
4
*
@@ -39,9 +39,10 @@ async function run() {
39
39
40
40
await connection . execute (
41
41
`CREATE OR REPLACE FUNCTION no_func
42
- (p1_in IN VARCHAR2, p2_in IN VARCHAR2) RETURN VARCHAR2
42
+ (p1_in IN VARCHAR2, p2_in IN VARCHAR2, p3_out OUT NUMBER ) RETURN VARCHAR2
43
43
AS
44
44
BEGIN
45
+ p3_out := 123;
45
46
RETURN p1_in || ' ' || p2_in;
46
47
END;`
47
48
) ;
@@ -50,17 +51,18 @@ async function run() {
50
51
//
51
52
// The equivalent call with PL/SQL named parameter syntax is:
52
53
// `BEGIN
53
- // :ret := no_func(p1_in => :p1, p2_in => :p2);
54
+ // :ret := no_func(p1_in => :p1, p2_in => :p2, p3_out => :p3 );
54
55
// END;`
55
56
56
57
const result = await connection . execute (
57
58
`BEGIN
58
- :ret := no_func(:p1, :p2);
59
+ :ret := no_func(:p1, :p2, :p3 );
59
60
END;` ,
60
61
{
61
62
p1 : 'Chris' , // Bind type is determined from the data. Default direction is BIND_IN
62
63
p2 : 'Jones' ,
63
- ret : { dir : oracledb . BIND_OUT , type : oracledb . STRING , maxSize : 40 }
64
+ p3 : { dir : oracledb . BIND_OUT , type : oracledb . NUMBER } ,
65
+ ret : { dir : oracledb . BIND_OUT , type : oracledb . STRING , maxSize : 40 }
64
66
} ) ;
65
67
66
68
console . log ( result . outBinds ) ;
0 commit comments