Oracle Database Multilingual Engine (MLE)

Welcome to the Oracle Database Multilingual Engine (MLE). MLE is an experimental feature for the Oracle Database 12c. MLE enables developers to work efficiently with DB-resident data in modern programming languages and development environments of their choice.

In the first release, we are providing users with a way to run stored procedures and user-defined functions written in JavaScript or TypeScript. We are also actively working on extending multilingual support to include other languages like Python.

Getting Started

Oracle Database MLE is available as a VirtualBox and as a Docker image. Both images can be downloaded from the Oracle Technology Network.

General Concepts

This section contains the definition of some terms used throughout this document.

Database Type

A Database Type is one of the types known to the Oracle Database. These types include numeric types like NUMBER, and character sequence types like VARCHAR2.

User-Defined Extension

A user-defined extension to the Oracle Database is a functional unit that is not provided by Oracle. The extension can be written in any of the supported extension languages.

The Oracle Database provides multiple ways to extend the database with user-defined functionality like user-defined functions (UDFs), user-defined aggregations (UDAs), stored procedures, table functions, triggers, to name a few.

User-Defined Function

A user-defined function (also UDF) is an extension to the database that can be used in queries. It returns one value for every time the function is called. If used inside a select query, it is called once for every row.

Stored Procedure

A stored procedure is an extension to the database that is not associated with a query. A user has to explicitly call a stored procedure. Furthermore, a stored procedure does not have a return value.

Callout

A callout is a SQL statement that is executed from within a UDF or a stored procedure. Callouts allow users to send SQL statements or PL/SQL blocks to the database from within a UDF or a stored procedure. This interaction is the primary building block to implement business logic inside the database.

Limitations

This version of Oracle Database MLE has a limited set of features. It only supports user-defined functions and stored procedures over a limited set of data types:

  • NUMBER
  • BINARY_DOUBLE
  • VARCHAR2

The support for VARCHAR2 is limited to the US7ASCII encoding. This encoding limit is also reflected at the deployment level: All source code deployed into an Oracle Database MLE instance is considered US7ASCII. There is currently no support for other types, but they are under active development.

User-defined extensions written in JavaScript are only supported in the form of UDFs and stored procedures. Usage of any other extension results in undefined behavior.

You cannot call JavaScript functions and procedures from PL/SQL. The only supported execution engine is the SQL engine that can be invoked from PL/SQL using dynamic SQL. Thus, user-defined extensions written in JavaScript will not work in queries using select into or returning. You also cannot call a JavaScript function directly from within a PL/SQL block without integrating it into a query.

Disclaimer & Feedback

Oracle Database Multilingual Engine (MLE for short) is an experimental option for Oracle Database 12c. This software is expected to be used as provided. Any changes to the database setup might result in an unusable database as well as loss of data and functionality.

Oracle Database MLE is being developed by Oracle Labs. This release is meant to give you a glimpse of our vision. Our goal is to engage with the community early. The primary goal of this early release is to get feedback from the community.

We have setup multiple feedback channels and would be extremely grateful for any comments, suggestions, or bug reports:

Some of the questions we want users to take a look at, are:

  • Is it easy to write JS functions and use them in SELECT, WHERE clauses, sub selects, INSERTs, etc.?
  • Is it easy to write JS functions with more sophisticated parameters (more than one, different data types, etc)?
  • Is it easy to write SQL within JS functions to get and put data from and into the database?
  • Is it convenient to load npm packages, also when they require other npm packages?
  • How easy is it to load multiple npm packages in your JS function?
  • Do you think you would be allowed loading third party open source packages into a production database in the first place?
  • Do you like the way how you have to declare your functions today, what can be done better, etc.

We are also actively looking for use cases, feature requests, and bug reports.