Oracle Application Express (MOSC)

MOSC Banner

ORA-04161: ReferenceError: fetch is not defined

In database version 21, I am using dbms_mle to get data from AP but this error occurs ORA-04161: ReferenceError: fetch is not defined:


DECLARE

ctx dbms_mle.context_handle_t;


user_code clob := q'~

let bindings = require('mle-js-bindings');

const aa = "https://staging3.onestopeg.co/get_credential?a_device_id=11&a_pass=123";

const request = fetch(aa);

const response = request.text();

const data = JSON.parse(response);

console.log(data.result);

~';

BEGIN

ctx := dbms_mle.create_context();

dbms_mle.eval(ctx, 'JAVASCRIPT', user_code);

dbms_mle.drop_context(ctx);

EXCEPTION

WHEN others THEN

dbms_mle.drop_context(ctx);

RAISE;

END;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center