node-odbc
node-odbc copied to clipboard
[BUG] callProcedure() does not put the return value in the results object
Describe your system
-
odbc
Package Version: 2.4.8 - unixODBC version: 2.3.9-1
- ODBC Driver: IBM i Access ODBC Driver 1.1.0.27-0
- Database Name: DB2 for i
- Database Version: IBM i 7.4
- Database OS: IBM i 7.4
- Node.js Version: v18.18.2
- Node.js OS: IBM i 7.4
Describe the bug When calling stored procedures with callProcedure(), the return value is not populated into the results object. Instead it's just undefined.
Expected behavior The results object property "return" should have the return value from the stored procedure.
Code to reproduce SQL to create an example stored procedure:
CREATE OR REPLACE PROCEDURE NODEODBC.test_return (
INOUT message varchar(128)
)
LANGUAGE SQL
BEGIN
set message = 'goodbye';
return 42;
END;
NodeJS code:
import odbc from 'odbc';
let conn = await odbc.connect('DSN=*LOCAL');
let parameters = ['hi there'];
let result = await conn.callProcedure(null, 'NODEODBC', 'TEST_RETURN', parameters);
console.log(result);
Results from NodeJS:
node stored-proc-return-value.js
[
statement: '{ CALL NODEODBC.TEST_RETURN (?) }',
parameters: [ 'goodbye' ],
return: undefined,
count: 0,
columns: []
]
Results from ACS Run SQL scripts:
call NODEODBC.test_return('hi there');
[ 02/06/2024, 11:20:41 AM ] Run Selected...
call NODEODBC.test_return('hi there')
Return Code = 42
Output Parameter #1 (MESSAGE) = goodbye
Statement ran successfully (2 ms)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still an issue/question
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still an open issue/question