I am trying to call an Oracle stored procedure using the node oracle driver - https://github.com/joeferner/node-oracle
I am able to call the procedure using the following code, but I am having an issue with the second parameter (parameterArray). It requires an array of items to be passed to it, in java we use the oracle.sql.ARRAY but how would I handle this with node js? My current code is as follows...
var oracle = require('oracle');
var connectData = {
hostname: "example_editted.com",
port: 1521,
database: "dev", // System ID (SID)
user: "user",
password: "password"
}
oracle.connect(connectData, function(err, connection) {
var starting_time = req.body.startDate + " 00:00:00"
var ending_time = req.body.endDate +" 00:00:00"
var parameterArray = {owner_id: req.body.accountId, time_min: null, time_max: null, duration_min: null, duration_max: null, date_format: "'MM/DD/YYYY HH24:MI:SS'", start_date: starting_time, end_date: ending_time}
connection.execute("call reporting.execute_report(:1, :2, :3)", ["ProcedureName", parameterArray,new oracle.OutParam()], function(err, results) {
The current error I am getting is
Assertion failed: (handle->InternalFieldCount() > 0), function Unwrap, file /Users/johnson/.node-gyp/0.10.35/src/node_object_wrap.h, line 61.
Abort trap: 6