-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
- What versions are you using?
"Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0"
oracledb version: 6.7.0
oracledb thin mode: false
oracle client version: 21.10.0.0.0
$ node --version
v18.18.0
-
Is it an error or a hang or a crash?
An error -
What error(s) or behavior you are seeing?
Note that I do not have a D: drive in my system. Also note that I am required to use thick mode because the current version of oracledb does not support NNE.
Error: internal error in file D:\git_files\node-oracledb\src\njsDbObject.c, line 795 (no error message)
at DbObject._setAttrValue (C:\Development\Git\ps\ps\node_modules\oracledb\lib\dbObject.js:107:16)
at DbObject.<anonymous> (C:\Development\Git\ps\ps\node_modules\oracledb\lib\dbObject.js:467:19)
at DbObject.set (C:\Development\Git\ps\ps\node_modules\oracledb\lib\connection.js:125:18)
at Function.assign (<anonymous>)
at new DbObject (C:\Development\Git\ps\ps\node_modules\oracledb\lib\connection.js:99:16)
at Object.transformValueIn (C:\Development\Git\ps\ps\node_modules\oracledb\lib\transformer.js:144:13)
at Connection._processBindValue (C:\Development\Git\ps\ps\node_modules\oracledb\lib\connection.js:309:37)
at Connection._processExecuteBind (C:\Development\Git\ps\ps\node_modules\oracledb\lib\connection.js:346:18)
at async Connection._processExecuteBinds (C:\Development\Git\ps\ps\node_modules\oracledb\lib\connection.js:395:9)
at async Connection.execute (C:\Development\Git\ps\ps\node_modules\oracledb\lib\connection.js:894:17) {
code: 'internal error in file D'
}
- Include a runnable Node.js script that shows the problem.
const oracledb = 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'));
async function executeSql() {
let pool = null, connection = null;
try {
pool = await oracledb.createPool({
user: '',
password: '',
connectString: ''
});
const num = 589508999999999999999n;
connection = await pool.getConnection();
await connection.execute('create or replace type MY_TYPE as object (TESTNUMBER number)');
let rs = await connection.execute(`declare myType MY_TYPE := :t; begin :t := myType; end;`, {
t: {
dir: oracledb.BIND_INOUT,
type: 'MY_TYPE',
val: {'TESTNUMBER': num}
}
}, {outFormat: oracledb.OUT_FORMAT_OBJECT});
console.log(JSON.stringify(rs.outBinds));
} catch (e) {
console.log(e);
} finally {
if (connection) {
await connection.execute('drop type MY_TYPE');
await connection.close();
}
if (pool) {
await pool.close(10);
}
}
}My own analysis:
The script executes successfully if I remove the n from 589508999999999999999n, albeit the number is rounded which is what I'm trying to avoid by using a BigInt. The script also executes successfully in thin mode without modification.
It is my understanding that this functionality should work with oracledb 6.7.0 thick mode, please correct me if I'm wrong.
Thank you for your help.