-
assigned issue to
INOUT Parameter Binding is not working properly
When calling an RPG Stored Procedure from Node.js with an in/out parameter the call does not contain the value I'm trying to pass. Changing the call parameter to input results in the value being passed correctly. The Stored Procedure is being created with "PARAMETER STYLE GENERAL."
Stored Procedure definition:
CREATE OR REPLACE PROCEDURE &LIB/WORMLSTSP (
INOUT gact CHAR(2)
, IN cusr CHAR(10)
The First Node.js Stored Proc call: getAction = 'RE'; stmt.bindParam([ [getAction, connection.db.SQL_PARAM_INPUT_OUTPUT, 1], [currentUser, connection.db.SQL_PARAM_INPUT, 1], ...
Result: The first Parameter's value is received by RPG as X'F02F' The stored procedure intentionally changed the value of the getAction parameter to 'OX' during the first call.
All Subsequent calls now send in OX, even though I'm explicitly setting the getAction to 'RE' before binding.
Changing the call to this works, but I don't get the new getAction value back: getAction = 'RE'; stmt.bindParam([ [getAction, connection.db.SQL_PARAM_INPUT, 1], [currentUser, connection.db.SQL_PARAM_INPUT, 1],
Please advise.
Comments (6)
-
-
Account Deactivated @krisbaehr Commit f844836 fixes the 'in/out parameter missing' issue. It is still being tested. If you wish to test it early, you can compile it with gcc.
-
reporter Thanks, @mengxumx
-
Account Deactivated Hello @krisbaehr , Would you verify if the issue is solved in idb-connector version 1.0.7?
-
reporter @mengxumx , I'm testing with 1.0.9 this morning and can confirm that the in/out parameter issue seems to be fixed. I've debugged the stored procedure to verify the values are going in, and coming out as expected, even after multiple calls. Thanks!
-
Account Deactivated - changed status to resolved
v1.0.9 fixed it
- Log in to comment
@xumeng, are we missing logic in the following block of code in db2stmt.cc?