I want to execute a stored procedure in Oracle, from my debian server with a nodejs file, in windows it works, but when i execute the same code in my debian server, it doesn't work, i cannot try with SQLPLUS because i don't have the permission on the server, that's the main reason because I'm trying with a nodejs.file
- Node Version debian server: 10.17.0
- Node Version Windows: 12.14.1
- node-oracledb version = 4.2.0
Error:
[Error: ORA-00900: invalid SQL statement] errorNum: 900, offset: 0 }
- ORACLE DB: 11g R1
Code:
const oracledb = require('oracledb');
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT;
const mypw = 'bikeutal'
async function run() {
let connection;
try {
connection = await oracledb.getConnection( {
user : "user",
password : mypw,
connectString : "host/sys"
});
const result = await connection.execute(
`exec actualizar_rating();`//bad
//`BEGIN BIKE_UTAL.ACTUALIZAR_RATING(); END ;`//bad
//`exec ACTUALIZAR_RATING()` //bad
//"CALL ACTUALIZAR_RATING()" //bad
//`EXECUTE ACTUALIZAR_RATING()`// bad
//`SELECT * FROM dev_viajes` //work
//
// console.log(result);
);
} catch (err) {
console.error(err);
} finally {
if (connection) {
try {
await connection.close();
} catch (err) {
console.error(err);
}
}
}
}
run();