node-ibm_db: CLI0123E: SQL data type out of range. SQLSTATE=HY004
I am having a problem with calling stored procedure that has output parameters. This is the error:
Data is missing from [object Object]
{ Error: [IBM][CLI Driver] CLI0123E SQL data type out of range. SQLSTATE=HY004 at Error (native)
errors: [],
error: '[node-odbc] SQL_ERROR',
message: '[IBM][CLI Driver] CLI0123E SQL data type out of range. SQLSTATE=HY004',
state: 'HY004' }
My code:
ibmdb.open(driver+hostname+port+db+user+psw+protocol, function (err,conn) {
if (err) return console.log(err);
var query = "CaLL name.mySP(?,?,?,?,?,?,?,?,?,?,?)";
var param1 = {ParamType:"INPUT", DataType:1, Data:""};
var param2 = {ParamType:"INPUT", DataType:1, Data:""};
var param3 = {ParamType:"INPUT", DataType:1, Data:76145};
var param4 = {ParamType:"INPUT", DataType:1, Data:0};
var param5 = {ParamType:"INPUT", DataType:1, Data:0};
var param6 = {ParamType:"INPUT", DataType:1, Data:0};
var param7 = {ParamType:"INPUT", DataType:1, Data:""};
var param8 = {ParamType:"OUTPUT", DataType:1, Data:0};
var param9 = {ParamType:"OUTPUT", DataType:1, Data:0};
var param10 = {ParamType:"OUTPUT", DataType:1, Data:""};
var param11 = {ParamType:"OUTPUT", DataType:1, Data:0};
conn.query(query, [param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11], function (err, data) {
if (err) console.log(err);
else console.log(data);
conn.close(function () { console.log('>> closed'); });
});
});
I was able to call stored procedure that has only input params but am unable to call any procedure that also has output params.
Any idea?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 36 (19 by maintainers)
Commits related to this issue
- Fix for issue #196 — committed to ibmdb/node-ibm_db by bimalkjha 8 years ago
- 2.0.0 * fix warning and installer update (bimalkjha) * latest node binaries for windows and nodejs version < 0.12.x support for node-ibm-db discontinued. (#228) (Rohit Pandey) * For issue #227 (bi... — committed to ibmdb/node-ibm_db by bimalkjha 7 years ago
@ljerka We have released the code changes for windows too. Please install ibm_db@1.0.2 and verify it. Thanks.
@ljerka Thank you for the explanation. We are looking into this and will come back with solution. 😃