I am trying to pass array in procedure as mentioned in following link but that array should be optional. I am doing bulk insert using forall in the procedure. but some time list can be empty as well and still other stuff in the procedure should be executed succesfully.
https://github.com/oracle/node-oracledb/blob/master/doc/api.md#plsqlindexbybinds
connection.execute(
"BEGIN mypkg.myinproc(:id, :vals); END;",
[
1234,
{ type: oracledb.NUMBER,
dir: oracledb.BIND_IN,
val: [1, 2, 23, 4, 10]
}
],
function (err) { . . . });
works find but if i don't want to pass vals i am getting errors
i tried
val:[]
val: null
val: undefined
and not having val at all
i am getting following error messages
when trying to pass null or undefined or do not pass:
PLS-00306: wrong number or types of arguments in call to 'INSERT_PROCEDURE'
When trying to pass empty array
NJS-039: empty array is not allowed for IN bind
I did a work around by passing array with null
val:[null]
and in procedure removing nulls from the list before executing FORALL.
this works for temporary but i would really like to solve this problem in proper way.