MLE Foreign Function Interface (FFI): API for calling PL/SQL functionality directly(mle-js-plsql-ffi)
    Preparing search index...

    Function resolveFunction

    • Resolve a PL/SQL top-level function by name.

      Parameters

      • name: string

      Returns DBSubprogram

      a JavaScript function that will execute the PL/SQL function when called and returns the PL/SQL return value.

      Similarly to the SQL driver this package has to deal with translating types between PL/SQL and JavaScript. Some PL/SQL types can be translated into multiple JavaScript types, so the return type can be overridden.

      // Resolve top-level function.
      const exampleFunc = resolveFunction('my_func');
      // Execute the PL/SQL function simply by calling the JS function.
      const numberResult = exampleFunc(42);
      // Override the return type of the function.
      const oracleNumberResult = exampleFunc.returns(oracledb.ORACLE_NUMBER)(42);