Support for Multilingual Engine
This feature is not available for MySQL database services.
Prerequisites
For the availability of MLE features, you need the:
-
DBMS_MLE
package in Oracle Database Release 21c and later versions. For more information, see DBMS_MLE in Oracle Database PL/SQL Packages and Types Reference. -
EXECUTE DYNAMIC MLE
andEXECUTE ON JAVASCRIPT
privileges assigned to you.
You can work with JavaScript code in the worksheet in the following ways:
- Create a JavaScript worksheet
- Execute JavaScript code in a standard worksheet
- Execute JavaScript code as a PL/SQL block
Create a JavaScript Worksheet
You can open the worksheet in JavaScript mode. In this mode, the toolbar icons and output tabs will change to support JavaScript code development.
To create and save a JavaScript worksheet:
- In the toolbar, expand the New File icon and select JavaScript.
- When you enter code in the worksheet, the JavaScript code is automatically highlighted.
- Execute the JavaScript code in the worksheet using Run Script.
-
Click Save.
In the Files pane, (JS) is added to the JavaScript file name. This enables you to quickly identify the JavaScript file.
Execute JavaScript code in a standard worksheet
In a standard worksheet (when the worksheet is not in JavaScript mode):
- Select the JavaScript code to execute.
- In the worksheet toolbar, expand the Run
Script icon and select Run as
JavaScript.
Note
Selecting Run as SQL script results in an error.
Execute JavaScript code as a PL/SQL block
You can use a PL/SQL code block to execute JavaScript code.
From the worksheet toolbar, expand the Run Script icon and select Run as SQL script (F5).