Skip to main content

Hi,

below is the javascript which I am trying to call but getting error.

Kindly help me

const oracle = require('oracle');

const connection = oracle.createConnection({
  host: '',
  port:'',
  user: '',
  password: '',
  servicename: ''
});

connection.connect();

const myProcedure = "CALL SPNAME(parameter1, parameter2, @return_code); SELECT @return_code;";

connection.query(myProcedure, u'?', '?'], (err, rows) => {
  if (err) {
    throw err;
  }

  const outputParam = rowsr1] 0]r'@return_code'];
  console.log(outputParam);
});

connection.end();

@Priyanka.H2 what error u r getting


Named export 'createConnection' not found. The requested module 'oracle' is a CommonJS module, which may not support all module.exports as named exports.


You are using this wrong. This script won’t run using run JavaScript action.
require() is not part of the standard JavaScript API. But in Node.js, it's a built-in function with a special purpose: to load modules.


can you please help me with the basic javascript code. I want to call the stored procedure with input parameter in AA.


Reply