12.1 APEXlang
12.1.1 generate
This command generates starter APEXlang application files. The generated application can be modified, validated, and imported into Oracle APEX.
- If files already exist in the target directory, they are overwritten.
- If the
-forceoption is used, the existing directory is removed and the files are recreated.
apex generate {options}Parameters
| Parameter | Description |
|---|---|
| -dir <dir> {PATH} | Specifies the output directory. If omitted, the current working directory is used. |
| -force | If the directory and files already exist at the specified location, using this parameter will remove all existing directory and files. |
| -name <name> {STRING} |
Specifies the application name to use in the generated application files instead of the default. If provided, the starter application files are updated with this name. If omitted, the default application name from the starter template is used. |
| -workspaceid <workspaceid> {INTEGER} | Specifies the workspace ID used to retrieve the corresponding workspace name for inclusion in the generated default deployment file. Requires a database connection. |
| -workspace <workspace> {STRING} | Specifies the workspace name to use for the generate, validate, or import commands when multiple workspaces are available in the current connection. If a workspace ID is also provided, it takes precedence over this option. |
| -id <id> {INTEGER} | Specifies the application ID to include in the generated default deployment file. |
| -alias <alias> {STRING} | Specifies the application alias to use in the generated application files instead of the default. |
| -schema <schema> {STRING} | Specifies the parsing schema to include in the generated default deployment file. |
-
Create starter application files in the current directory:
apex generate -
Create starter application files in a specified directory with a custom name:
apex generate -name "Hello World" -dir ./projects
12.1.2 export
This command exports an existing Oracle APEX application.
APEXlang is a new export format for generating application source files in APEXlang structure.
This command requires a database connection.
Note the following when exporting in APEXlang format to a location that already contains the source files:
- If the
-forceoption is not used, the existing files will be overwritten by the exported files. - The existing default deployment file is handled differently:
- It is merged with the exported default deployment file.
- Existing properties are preserved.
- Only new properties from the exported file are added.
apex export -applicationid <id> [options]New Parameters
| Parameter | Description |
|---|---|
|
Required -applicationid <applicationid> {INTEGER} |
Specifies the application ID to export. |
| -dir <dir> {PATH} | Specifies the output directory for generated files. If the directory is not specified, it defaults to the current working directory. |
| -force | If the directory and files already exist at the
specified location, using this parameter will remove the existing
directory and files. If the -components parameter
is also used, only the component files will be removed.
|
| -exptype <exptype> {APEXLANG|SQL...} | Specifies the export format:
|
| -expcomments |
Exports developer comments. This option is deprecated for APEX 26.1 and later, as comments
are included in exports by default. To exclude comments, use the
A warning is displayed if this option is used with APEX 26.1 or later. |
| -disable-exp-comments | Excludes comments in the export for APEX 26.1 and
later. For earlier APEX versions, use the
expcomments option instead.
A warning is displayed if this option is used with APEX versions earlier than 26.1. |
-
Export the application to the current directory:
apex export -applicationid 105 -exptype APEXLANG -
Export the application to the specified directory:
apex export -applicationid 105 -dir ./projects
12.1.3 validate
This command validates APEXlang source by compiling it and reporting any syntax or compilation errors.
-
This command does not require a database connection.
-
If no input is specified, the current directory is used.
-
Before compilation, the command checks for the presence of APEXlang files.
-
If a default or specified deployment file is present, its values are applied during execution and may affect validation.
-
The MMD version defined in
.apex/apexlang.jsondetermines which APEXlang compiler version is used and may affect validation. For more information about the .apex/ directory, see Hidden Configuration Directory.If the file or the MMD version property is not found, the latest compiler version is used.
-
If a database connection is available, SQLcl may retrieve additional information from the database to support compilation.
apex validate [options]Parameters
| Parameter | Description |
|---|---|
| -input <input> {PATH} |
Specifies the path to the APEXlang input. This can be a directory, a zip file, or a single APEXlang file containing the entire application. If provided, the specified path is used as input. If omitted, the current directory is used. When using a single file as input, it must contain the entire application. |
| -workspaceid <workspaceid> {INTEGER} | Specifies the workspace ID to use when multiple workspaces are available in the connection. |
| -workspace <workspace> {STRING} | Specifies the workspace name to use for the validate or import command when multiple workspaces are available in the current connection. If a workspace ID is also provided, it takes precedence over this option. |
| -deployment <deployment> {STRING} |
Specifies the path to the deployment file to use for import. If only a filename is provided, the file is looked up in the
If a full or relative path is provided, that path is used directly to locate the file. |
| -debug | Enables debug output.
Displays detailed information about values retrieved or read from the deployment file that are used during compilation. |
- Validate using the current directory as
input:
apex validate - Validate a specific
directory:
apex validate -input ./projects/Brookstrut
12.1.4 import
The import command compiles the APEXlang input and executes
the resulting PL/SQL to create or update an APEX application.
- This command requires a database connection.
- Deployments/default.json is used to store deployment configurations.
Some values can be overriden by user-provided SQLcl command options. SQLcl
prepends PL/SQL blocks to the compiled output to apply these values during
import. For more information, see Attributes Manipulated by
APEX_APPLICATION_INSTALL.
- If deployments/default.json exists in the source input, that will be used by default.
- If override options are provided (for example,
-workspaceid,-applicationid), they take precedence over the deployment file. - If no deployment file is present and insufficient options are provided, some values may be inferred from the database connection.
- If required information cannot be determined, the command will return an error or prompt for the missing values.
- If no input path is specified, the current directory is used.
apex import [options]Parameters
| Parameter | Description |
|---|---|
| -input <input> {PATH} |
Specifies the path to the APEXlang input. This can be a directory, a zip file, or a single APEXlang file containing the entire application. If provided, the specified path is used as input. If omitted, the current directory is used. When using a single file as input, it must contain the entire application. |
| -deployment <deployment> {STRING} |
Specifies the path to the deployment file to use for import. If only a filename is provided, the file is looked
up in the If a full or relative path is provided, that path is used directly to locate the file. |
| -debug |
Enables debug output. Displays detailed information about values retrieved or read from the deployment file that are used during compilation. |
These parameters override values defined in the deployment file or APEXlang files. They are useful for creating a duplicate of an application for testing or deploying the application to a different workspace.
| Parameter | Description |
|---|---|
| -workspace <workspace> {STRING} | Specifies the workspace name to use for the validate or import command when multiple workspaces are available in the current connection. If a workspace ID is also provided, it takes precedence over this option. |
| -workspaceid <workspaceid> {INTEGER} |
Specifies the APEX workspace ID where the application will be imported. If omitted, the workspace defined in the deployment file is used. If no deployment file or workspace value is available, the workspace is determined from the current database connection. |
| -id <id> {INTEGER} |
Specifies the APEX application ID to use for the import. If omitted, the application ID defined in the deployment file is used. If no deployment file or application ID is available, a new application ID is generated based on the current database connection. |
| -name <name> {STRING} |
Specifies the APEX application name to use for the import. If omitted, the application name defined in the APEXlang code or deployment file is used. |
| -alias <alias> {STRING} |
Specifies the APEX application alias to use for the import. If omitted, the application alias defined in the APEXlang code or deployment file is used. |
| -schema <schema> {STRING} |
Specifies the APEX application schema to use for the import. If omitted, the application schema defined in the APEXlang code or deployment file is used. |
| -image-prefix <image-prefix> {STRING} |
Specifies the APEX application image prefix to use for the import. If omitted, the image prefix defined in the APEXlang code or deployment file is used. |
| -proxy <proxy> {STRING} |
Specifies the APEX application proxy to use for the import. If omitted, the application proxy defined in the APEXlang code or deployment file is used. |
- Import using the current directory as
input:
apex import - Import the application with overridden values (for example, a different ID and
name):
apex import -input ./projects/Brookstrut -id 105 -name "Burner App"