Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] callProcedure() does not put the return value in the results object #367

Open
brandonp42 opened this issue Feb 6, 2024 · 4 comments

Comments

@brandonp42
Copy link

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)
Copy link

stale bot commented May 7, 2024

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.

@stale stale bot added the stale This issue hasn't seen any interaction in 30 days. label May 7, 2024
@brandonp42
Copy link
Author

Still an issue/question

@stale stale bot removed the stale This issue hasn't seen any interaction in 30 days. label May 7, 2024
Copy link

stale bot commented Aug 5, 2024

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.

@stale stale bot added the stale This issue hasn't seen any interaction in 30 days. label Aug 5, 2024
@brandonp42
Copy link
Author

Still an open issue/question

@kadler kadler added confirmed and removed stale This issue hasn't seen any interaction in 30 days. labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants