Using JavaScript Modules in MLE
JavaScript modules can be used in several different ways and can be managed using a set of Data Definition Language (DDL) commands.
JavaScript code provided in MLE modules can be used in the following ways:
-
A JavaScript function exported by an MLE module can be published by creating a call specification known as an MLE module call. This allows the function to be called directly from SQL and PL/SQL.
-
Functionality exported by a JavaScript MLE module can be imported in other MLE JavaScript modules.
-
Code snippets in
DBMS_MLE
can import modules for dynamic invocation of JavaScript.
Before a user can create and execute MLE modules, several privileges must be granted.
See Also:
-
Overview of Importing MLE JavaScript Modules for more information about module calls
-
Overview of Dynamic MLE Execution for more information about
DBMS_MLE
and dynamic invocation of JavaScript code in the database -
System and Object Privileges Required for Working with JavaScript in MLE for more information about MLE-specific privileges
Topics
- Managing JavaScript Modules in the Database
SQL allows the creation of MLE modules as schema objects, assuming the necessary privileges are in place. - Preparing JavaScript code for MLE Module Calls
JavaScript modules in MLE follow the ECMAScript 6 standard for modules. Functions and variables expected to be consumed by users of the MLE module must be exported. - Additional Options for Providing JavaScript Code to MLE
The JavaScript source code of an MLE module can be specified inline with PL/SQL but can also be provided using a BFILE, BLOB, or CLOB, in which case the source file must be UTF8 encoded. - Specifying Module Version Information and Providing JSON Metadata
MLE modules may carry optional metadata in the form of a version string and free-form JSON-valued metadata. - Drop JavaScript Modules
TheDROP MLE MODULE
DDL statement is used for dropping an MLE module. - Alter JavaScript Modules
Attributes of an MLE module can be assigned or altered using theALTER MLE MODULE
statement. - Overview of Built-in JavaScript Modules
MLE provides a set of built-in JavaScript modules that are available for import in any execution context. - Dictionary Views Related to MLE JavaScript Modules
The Data Dictionary includes details about JavaScript modules.
Parent topic: MLE JavaScript Modules and Environments