Oracle DBMS_MLE Version 23c |
---|
General Information | |||||||
Library Note |
|
||||||
Purpose | This Multi-Lingual Engine (MLE) package allows users to execute JavaScript code inside the Oracle Database and exchange data seamlessly between PL/SQL and JavaScript.
The JavaScript code itself can execute PL/SQL and SQL through built-in JavaScript modules. JavaScript data types are automatically mapped to Oracle Database data types and vice versa. With the DBMS_MLE package, developers can write their data processing logic in JavaScript. The runtime state for MLE execution is encapsulated in execution contexts that users can explicitly create and destroy. Users can also export values from PL/SQL to MLE, and import values from MLE back into PL/SQL. -- The flow of dynamic MLE execution will typically look like this: -- ---------------- |
||||||
AUTHID | CURRENT_USER | ||||||
Data Types | SUBTYPE context_handle_t IS RAW(16); -- type for context handle |
||||||
Dependencies |
|
||||||
Documented | Yes: Packages and Types Reference | ||||||
Exceptions |
|
||||||
First Available | 20c | ||||||
Object Privilege | The COLLECT DEBUG INFO privilege controls whether a user, who does not own a module, but has the EXECUTE privilege can debug the module. | ||||||
Pragmas | PRAGMA SUPPLEMENTAL_LOG_DATA(default, NONE); | ||||||
Security Model | Owned by SYS with EXECUTE granted to PUBLIC EXECUTE DYNAMIC MLE system privilege is required for some functionality |
||||||
Source | {ORACLE_HOME}/rdbms/admin/dbmsmle.sql {ORACLE_HOME}/rdbms/admin/prvtmle.plb |
||||||
Subprograms |
|
||||||
CREATE_CONTEXT (new 23c parameter) ![]() |
|||||||
Creates an MLE context for executing snippets in any MLE language | dbms_mle.create_context(environment IN VARCHAR2 DEFAULT NULL) RETURN context_handle_t; |
||||||
See Demo At Page Bottom |
|||||||
DISABLE_CTX_STDERR | |||||||
Disables stderr stream of the specified MLE context, so that future writes to stderr are discarded | dbms_mle.disable_ctx_stderr(context_handle IN context_handle_t); |
||||||
DECLARE |
|||||||
DISABLE_CTX_STDOUT | |||||||
Disables stdout stream of the specified MLE context, so that future writes to stdout are discarded | dbms_mle.disable_ctx_stdout(context_handle IN context_handle_t); |
||||||
See DISABLE_CTX_STDERR Demo Above |
|||||||
DISABLE_DEBUGGING (new 23c) ![]() |
|||||||
Disables currently enabled debug points for the current session | dbms_mle.disable_debugging; |
||||||
exec dbms_mle.disable_debugging; |
|||||||
DISABLE_ICS_STDERR (new 23c) ![]() |
|||||||
Disables the stderr stream of the inlined MLE call so future writes to stderr are discarded | dbms_mle.disable_ics_stderr(name IN VARCHAR2); |
||||||
TBD | |||||||
DISABLE_ICS_STDOUT (new 23c) ![]() |
|||||||
Disables the stdout stream of the inlined MLE call so future writes to stdout are discarded | dbms_mle.disable_ics_stdout(name IN VARCHAR2); |
||||||
TBD | |||||||
DISABLE_STDERR (new 23c overloads and parameters) ![]() |
|||||||
Disables the stderr stream of all MLE contexts, so that future writes to stderr are discarded Overload 1 |
dbms_mle.disable_stderr(module_name IN VARCHAR2); |
||||||
TBD | |||||||
Overload 2 | dbms_mle.disable_stderr( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.disable_stderr; |
||||||
See DISABLE_CTX_STDERR Demo Above |
|||||||
DISABLE_STDOUT (new 23c overloads and parameters) ![]() |
|||||||
Disables the stdout stream of all MLE contexts, so that future writes to stdout are discarded Overload 1 |
dbms_mle.disable_stdout(module_name IN VARCHAR2); |
||||||
TBD | |||||||
Overload 2 | dbms_mle.disable_stdout( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.disable_stdout; |
||||||
See DISABLE_CTX_STDERR Demo Above |
|||||||
DROP_CONTEXT | |||||||
Drop an MLE context created using CREATE_CONTEXT | dbms_mle.drop_context(context_handle IN context_handle_t); |
||||||
See Demo At Page Bottom |
|||||||
ENABLE_DEBUGGING (new 23c) ![]() |
|||||||
Enable a set of debugpoints for the current session | dbms_mle.disable_debugging( |
||||||
TBD | |||||||
EVAL (new 23c parameters) ![]() |
|||||||
Executes the given MLE language code within the context identified by the context handle Overload 1 |
dbms_mle.eval( |
||||||
See Demo At Page Bottom |
|||||||
Overload 2 | dbms_mle.eval( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.eval( |
||||||
TBD | |||||||
Overload 4 | dbms_mle.eval( |
||||||
TBD | |||||||
EXPORT_CHAR | |||||||
Assigns the given value, with appropriate conversion, to the named property in the MLE context. The property is created if it is not already present. | dbms_mle.export_char( |
||||||
TBD | |||||||
EXPORT_RAW | |||||||
Assigns the given value, with appropriate conversion, to the named property in the MLE context. The property is created if it is not already present. | dbms_mle.export_raw( |
||||||
TBD | |||||||
EXPORT_TO_MLE (new 23c overload) ![]() |
|||||||
Assigns the given value, with appropriate conversion, to the named property in the MLE context. The property is created if it is not already present. Overload 1 |
dbms_mle.export_to_mle( |
||||||
See Demo At Page Bottom |
|||||||
Overload 2 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 4 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 5 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 6 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 7 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 8 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 9 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 10 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 11 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 12 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 13 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
Overload 14 | dbms_mle.export_to_mle( |
||||||
TBD | |||||||
EXPORT_UROWID | |||||||
Assigns the given value, with appropriate conversion, to the named property in the MLE context. The property is created if it is not already present. | dbms_mle.export_urowid( |
||||||
TBD | |||||||
GET_AVAILABLE_LANGUAGES | |||||||
Returns the set of available languages As of the initial release of 21c, and in 23c, the only supported language is JAVASCRIPT |
dbms_mle.get_available_languages RETURN languages_t; |
||||||
DECLARE |
|||||||
GET_CTX_ERROR_STACK | |||||||
Returns the MLE language stack trace for the most recent application error in the given execution context | dbms_mle.get_ctx_error_stack(context_handle IN context_handle_t) |
||||||
TBD | |||||||
GET_ERROR_STACK (new 23c) ![]() |
|||||||
Retrieves the MLE language stack trace for the most recent application error in the given module/environment call | dbms_mle.get_error_stack( |
||||||
TBD | |||||||
IMPORT_CHAR | |||||||
Retrieves the value of the named property from the MLE context and converts it to the requested PL/SQL type | dbms_mle.import_char( |
||||||
TBD | |||||||
IMPORT_FROM_MLE (new 23c overload) ![]() |
|||||||
Retrieves the value of the named property from the MLE context and converts it to the requested PL/SQL type Overload 1 |
dbms_mle.import_from_mle( |
||||||
See Demo At Page Bottom |
|||||||
Overload 2 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 4 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 5 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 6 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 7 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 8 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 9 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 10 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 11 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 12 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 13 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
Overload 14 | dbms_mle.import_from_mle( |
||||||
TBD | |||||||
IMPORT_RAW | |||||||
Retrieves the value of the named property from the MLE context and converts it to the requested PL/SQL type | dbms_mle.import_raw( |
||||||
TBD | |||||||
IMPORT_UROWID | |||||||
Retrieves the value of the named property from the MLE context and converts it to the requested PL/SQL type | dbms_mle.import_urowid( |
||||||
TBD | |||||||
PARSE_DEBUG_OUTPUT (new 23c) ![]() |
|||||||
Given a BLOB containing MLE debug output in the Java heap dump format, returns a JSON representation of the debug output.\ | dbms_mle.parse_debug_output(debugoutput IN BLOB) RETURN JSON; |
||||||
TBD | |||||||
SET_CTX_STDERR | |||||||
Redirect the stderr stream of the MLE context to the given CLOB | dbms_mle.set_ctx_stderr( |
||||||
TBD | |||||||
SET_CTX_STDERR_TO_DBMS_OUTPUT | |||||||
Redirect the stderr stream of the MLE context to DBMS_OUTPUT | dbms_mle.set_ctx_stderr_to_dbms_output(context_handle IN context_handle_t); |
||||||
TBD | |||||||
SET_CTX_STDOUT | |||||||
Redirect the stdout stream of the MLE context to the given CLOB | dbms_mle.set_ctx_stdout( |
||||||
TBD | |||||||
SET_CTX_STDOUT_TO_DBMS_OUTPUT | |||||||
Redirect the stdout stream of the MLE context to DBMS_OUTPUT | dbms_mle.set_ctx_stdout_to_dbms_output(context_handle IN context_handle_t); |
||||||
TBD | |||||||
SET_ICS_STDERR (new 23c) ![]() |
|||||||
Redirects the stderr stream of an inlined MLE call to a CLOB | dbms_mle.set_ics_stderr( |
||||||
TBD | |||||||
SET_ICS_STDERR_TO_DBMS_OUTPUT (ew 23c) ![]() |
|||||||
Redirects the stderr ICS stream to DBMS_OUTPUT | dbms_mle.set_ics_stderr_to_dbms_output(module_name IN VARCHAR2); |
||||||
TBD | |||||||
SET_ICS_STDOUT (new 23c) ![]() |
|||||||
Redirects the stdout stream of an inlined MLE call to a CLOB | dbms_mle.set_icd_stdout( |
||||||
TBD | |||||||
SET_ICS_STDOUT_TO_DBMS_OUTPUT (new 23c) ![]() |
|||||||
Redirects the stdout ICS stream to DBMS_OUTPUT | dbms_mle.set_ics_stdout_to_dbms_output(module_name IN VARCHAR2); |
||||||
TBD | |||||||
SET_STDERR (new 23c overloads and parameters) ![]() |
|||||||
Redirect the stderr stream of all MLE contexts to the given CLOB | dbms_mle.set_stderr( |
||||||
TBD | |||||||
Overload 2 | dbms_mle.set_stderr( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.set_stderr(sink IN OUT NOCOPY CLOB CHARACTER SET ANY_CS); |
||||||
TBD | |||||||
SET_STDERR_TO_DBMS_OUTPUT (new 23c overloads and parameters) ![]() |
|||||||
Redirect the stderr stream of all MLE contexts to DBMS_OUTPUT | dbms_mle.set_stderr_to_dbms_output(module_name IN VARCHAR2); |
||||||
TBD | |||||||
Overload 2 | dbms_mle.set_stderr_to_dbms_output( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.set_stderr_to_dbms_output; |
||||||
exec dbms_mle.set_stderr_to_dbms_output; |
|||||||
SET_STDOUT (new 23c overloads and parameters) ![]() |
|||||||
Redirect the stdout stream of all MLE contexts to the given CLOB | dbms_mle.set_stdout( |
||||||
TBD | |||||||
Overload 2 | dbms_mle.set_stdout( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.set_stdout(sink IN OUT NOCOPY CLOB CHARACTER SET ANY_CS); |
||||||
TBD | |||||||
SET_STDOUT_TO_DBMS_OUTPUT (new 23c overloads and overloads) ![]() |
|||||||
Redirect the stdout stream of all MLE contexts to DBMS_OUTPUT | dbms_mle.set_stdout_to_dbms_output(module_name IN VARCHAR2); |
||||||
TBD | |||||||
Overload 2 | dbms_mle.set_stdout_to_dbms_output( |
||||||
TBD | |||||||
Overload 3 | dbms_mle.set_stdout_to_dbms_output; |
||||||
exec dbms_mle.set_stdout_to_dbms_output; |
|||||||
Demo | |||||||
The demo, at right, is based on the demo in the Oracle docs | set serveroutput on; |
Related Topics |
Built-in Functions |
Built-in Packages |
Database Security |
What's New In 21c |
What's New In 23c |
This site is maintained by Dan Morgan. Last Updated: | This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2023 Daniel A. Morgan All Rights Reserved | |||||||||
|
||||||||||