-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
-
What versions are you using?
oracle version 19cprocess.platform
darwin
process.version
v18.16.0
process.arch
arm64
require('oracledb').versionString
6.0.0 -
Is it an error or a hang or a crash?
error -
What error(s) or behavior you are seeing?
Error: ORA-01460: unimplemented or unreasonable conversion requested
- Include a runnable Node.js script that shows the problem.
const oracledb = require('oracledb')
const dbConfig = {
user: process.env.NODE_ORACLEDB_USER,
password: process.env.NODE_ORACLEDB_PASSWORD,
connectString: process.env.NODE_ORACLEDB_CONNECTIONSTRING,
}
async function run() {
let connection
try {
let sql, binds, options, result
connection = await oracledb.getConnection(dbConfig)
const stmts = [
`DROP TABLE no_example`,
`CREATE TABLE no_example (id NUMBER, data VARCHAR2(20))`,
]
for (const s of stmts) {
try {
await connection.execute(s)
} catch (e) {
if (e.errorNum != 942) console.error(e)
}
}
sql = `INSERT INTO no_example VALUES (:1, :2)`
binds = [
[101, 'Alpha'],
[102, 'Beta'],
[103, 'Gamma'],
]
// For a complete list of options see the documentation.
options = {
autoCommit: true,
// batchErrors: true, // continue processing even if there are data errors
bindDefs: [
{ type: oracledb.NUMBER },
{ type: oracledb.STRING, maxSize: 20 },
],
}
result = await connection.executeMany(sql, binds, options)
console.log('Number of rows inserted:', result.rowsAffected)
//
// Query the data
//
sql = `SELECT * FROM no_example WHERE data=:variable`
binds = { variable: 'ä' }
// For a complete list of options see the documentation.
options = {
outFormat: oracledb.OUT_FORMAT_OBJECT, // query result format
// extendedMetaData: true, // get extra metadata
// fetchArraySize: 100 // internal buffer allocation size for tuning
}
result = await connection.execute(sql, binds, options)
// Column metadata can be shown, if desired
// console.log("Metadata: ");
// console.dir(result.metaData, { depth: null });
console.log('Query results: ')
console.dir(result.rows, { depth: null })
} catch (err) {
console.error(err)
} finally {
if (connection) {
try {
await connection.close()
} catch (err) {
console.error(err)
}
}
}
}
run()
Run with command NODE_ORACLEDB_USER=SYSTEM NODE_ORACLEDB_PASSWORD=oracle NODE_ORACLEDB_CONNECTIONSTRING=local.oracle.com:1521/xe node test.js
If I change this row binds = { variable: 'ä' } to binds = { variable: 'a' }, then it works without a problem
This problem didn't exist in version 5.5.0.