-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executeMany raises Error: NJS-012: encountered invalid bind data type in parameter 2 #1595
Comments
Thanks for reporting the issue. We are looking into it. Note that the default behavior after node-oracledb 6.0 is the Thin mode. |
@mostafa-gado The parameter 2 Please specify the exact INSERT statement that you used, which ran correctly. Does it have the same bind values? Did you run the INSERT statement in a Node.js program or as a separate SQL? |
@mostafa-gado since you have binds with input and output, Can you provide
|
@sharadraju Yes I called |
@sudarshan12s Changing the qty to int doesn't solve the issue. I updated the post with the insert statement. |
@sudarshan12s Using bindDefs raised a different error:
|
Can you give me the complete program or the executeMany arguments you passed. I passed same as in my comment, it works . Above error can come if the bind values doesn't match the type mentioned in bindDefs like if we pass string but its type is defined as I modified your program to something like this which works. similar examples are in test folder
|
@sudarshan12s Ok I found the issue. After carefully examining your code I noticed you are only adding the R_STATE definition in the bindDefs. But I was adding the R_STATE definition twice. Once in the dummyItems and again in the bindDefs. Once I removed it from the dummyItems It worked. |
I think I found some inconsistency between |
6.0.3
Give your database version.
Oracle Cloud ATP 21c
process.platform:
'win32'
process.version:
'v18.12.1'
process.arch:
'x64'
require('oracledb').versionString:
'6.0.3'
require('oracledb').oracleClientVersionString:
Uncaught:
Error: NJS-089: getting the Oracle Client version is not supported by node-oracledb in Thin mode
at throwErr (D:\Apps\ERP\etit-erp-backend\node_modules\oracledb\lib\errors.js:592:10)
at Object.throwNotImplemented (D:\Apps\ERP\etit-erp-backend\node_modules\oracledb\lib\errors.js:601:3)
at get oracleClientVersionString [as oracleClientVersionString] (D:\Apps\ERP\etit-erp-backend\node_modules\oracledb\lib\oracledb.js:1064:14) {
code: 'NJS-089'
}
But I am running in Thick mode!
Is it an error or a hang or a crash?
Error
What error(s) or behavior you are seeing?
Error: NJS-012: encountered invalid bind data type in parameter 2
I am trying to use executeMany to run a procedure in the database but I am getting this error "Error: NJS-012: encountered invalid bind data type in parameter 2".
The database proc:
The node.js code:
The strange thing is If I ran the same executeMany with the same parameters but instead of calling the proc I call the same insert statement, It works. The same insert statement that is inside the proc.
The insert statement as requested by @sudarshan12s :
The text was updated successfully, but these errors were encountered: