ORACLE: Stored procedure issue using "raw()"
See original GitHub issueKnex version : 0.12.6
I get what it seems to be a Bluebird error when I try to execute an Oracle stored procedure using raw() :
knex.raw("BEGIN MY.STORED.PROCEDURE(?, ?, ?); END;",
[
{ "dir": oracledb.BIND_IN, "type": oracledb.NUMBER, "val": 13036 },
{ "dir": oracledb.BIND_OUT, "type": oracledb.NUMBER },
{ "dir": oracledb.BIND_OUT, "type": oracledb.NUMBER }
]).then((result) => {
console.log("Success : " + JSON.stringify(result));
}).catch((err) => {
console.log("Error : " + err);
});
This results in the error :
Error : TypeError: BEGIN MY.STORED.PROCEDURE(:1, :2, :3); END; - expecting an array or an iterable object but got [object Null]
If I debug, I see that the request works, Oracle response is correct. Here’s a screenshot of a breakpoint in file node_modules/knex/lib/dialects/oracledb/index.js, line 162 :

The err is null, there are no rows or resultSet in the results object but a outBinds array, containing the OUT parameters of the stored procedure call.
The error actually occures when line 205 is reached :
resultResolve(results);
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:16 (4 by maintainers)
Top Results From Across the Web
RAW datatype - input parameter in procedure — oracle-tech
Hi, I have created a procedure (Pasted below). ... For example, you can build a RAW from a string with HEXTORAW() function.
Read more >Passing array of raw(32) argument to Oracle Stored ...
When calling a stored procedure once with an array (rather than calling a procedure that takes atomic items, and calling it multiple times), ......
Read more >Programming in Oracle with PL/SQL
Allows using general programming tools with ... Long raw – stores large blocks of data stored in ... A stored procedure is a...
Read more >Calling Oracle Stored Procedures Having Out Cursor Parameter
Hey all, I have to call some pre-existing Oracle stored procedures that have cursor out parameters. I've had no luck doing this short...
Read more >Create and Execute simple SELECT Stored Procedure in ...
... create and run / execute a simple Oracle stored procedure in PL SQL. ... simple SELECT Stored Procedure in Oracle PL SQL...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Not a “fix”, but what we do now is to use a raw connection taken from Knex’s connection pool when we need to use a stored proc with out parameters :
Hi!
Any update in this? I’m having the same problem using knex and oracledb.
Any workaround to solve this?