You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This error happens in oracledb version 6 using thick mode.
Error: ORA-21525: attribute number or (collection element at index) %s violated its constraints
at async executeSql (C:\...\oracledb6.js:22:18) {
errorNum: 21525,
offset: 0,
code: 'ORA-21525'
}
Include a runnable Node.js script that shows the problem.
I created the following script and ran it on oracledb 6.0.3, 6.0.0, 5.5.0, 4.2.0 (see below for output).
Please note that I am required to use thick mode as the current oracledb version does not support NNE.
constoracledb=require('oracledb');oracledb.initOracleClient({});console.log('oracledb version: '+oracledb.versionString);console.log('oracledb thin mode: '+oracledb.thin);if(!oracledb.thin){console.log('oracle client version: '+oracledb.oracleClientVersionString);}executeSql().then(()=>console.log('Done'));asyncfunctionexecuteSql(){letpool=null,connection=null;try{pool=awaitoracledb.createPool({user: '',password: '',connectString: ''});connection=awaitpool.getConnection();awaitconnection.execute('create or replace type MY_TYPE as object (TESTNUMBER number (12, 0))');letrs=awaitconnection.execute(`declare myType MY_TYPE := :t; begin myType.TESTNUMBER := 2; :t := myType; end;`,{t: {dir: oracledb.BIND_INOUT,type: 'MY_TYPE',val: {'TESTNUMBER': 1}}},{outFormat: oracledb.OUT_FORMAT_OBJECT});console.log(JSON.stringify(rs.outBinds));}catch(e){console.log(e);}finally{if(connection){awaitconnection.execute('drop type MY_TYPE');awaitconnection.close();}if(pool){awaitpool.close(10);}}}
oracledb version: 6.0.3
oracledb thin mode: false
oracle client version: 21.10.0.0.0
Error: ORA-21525: attribute number or (collection element at index) %s violated its constraints
at async executeSql (C:\...\oracledb6.js:22:18) {
errorNum: 21525,
offset: 0,
code: 'ORA-21525'
}
Done
Some of my own analysis:
The issue appears to be related to the number constraint in my type. If I change the constraint to NUMBER(22,0) then the script works successfully. Other smaller values work too such as (20,0) and (14,0), but for some reason (12,0), (11,0), etc. don't work anymore since oracledb version 6.
Thank you in advance for any help in resolving this issue.
The text was updated successfully, but these errors were encountered:
Oracle database version: "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0"
NLS_CHARACTERSET: AL32UTF8
process.platform=win32
process.version=v16.10.0
process.arch=x64
Note that this issue affects nodejs running on linux as well.
oracledb version: 6.0.3 (thick mode)
oracle client version: 21.10.0.0.0
Is it an error or a hang or a crash? An exception
What error(s) or behavior you are seeing?
This error happens in oracledb version 6 using thick mode.
I created the following script and ran it on oracledb 6.0.3, 6.0.0, 5.5.0, 4.2.0 (see below for output).
Please note that I am required to use thick mode as the current oracledb version does not support NNE.
Some of my own analysis:
The issue appears to be related to the number constraint in my type. If I change the constraint to NUMBER(22,0) then the script works successfully. Other smaller values work too such as (20,0) and (14,0), but for some reason (12,0), (11,0), etc. don't work anymore since oracledb version 6.
Thank you in advance for any help in resolving this issue.
The text was updated successfully, but these errors were encountered: