Idea Summary
APEX apps in APEXlang format can be exported via APEX_EXPORT API but cannot be imported via APEX_APPLICATION_INSTALL again. Installing large APEX apps via SQLcl is very slow compared to the alternatives, especially if the application is split into individual files.
Use Case
Starting with version 26.1, the APEX Builder supports importing zipped APEX apps in the APEXlang format. However, in a production runtime environment, there is no APEX Builder, so you have no choice but to use SQLcl. In any case, this is currently the only option for automated installations.
Installing a larger APEX app in SQL format using SQLcl takes about 5–6 times as long as using a simple REST API that calls APEX_APPLICATION_INSTALL.INSTALL. We manage a large multi-tenant system with many APEX apps that are rolled out on a regular schedule. The difference in rollout time for an entire system is several hours. SQLcl is therefore not suitable for us when it comes to importing APEX apps.
Since development has switched to the human-readable APEXlang format, direct support for APEX_APPLICATION_INSTALL.INSTALL during rollout is desirable. If you try this right now, you'll just see an error message saying that the file “application.apx” cannot be found. This leads developers to assume that importing via this method is probably possible. As Oracle Support confirmed, this is not a bug, but rather a lack of documentation indicating that this is not currently supported.
Preferred Solution
When importing ZIP files containing APEXlang files, the APEX Builder sends them internally to ORDS, which validates them and returns a compiled version. Apparently, the entire logic is already present in the internal APIs; it just needs to be integrated into APEX_APPLICATION_INSTALL.INSTALL.
The INSTALL procedure should check whether P_SOURCE, of type APEX_T_EXPORT_FILES, consists of a zip file only; if so, it searches for install.sql or application.apx. If the APEXlang format is found, the zip file is sent to ORDS for compilation. From this point on, the process could proceed identically for both formats.