← All articles

Validate APEXlang Without a Database: SQLcl apex validate for CI and AI Agents

SQLcl can validate an exported Oracle APEX application in APEXlang format with no database connection. Here is what apex validate checks, how to read and log its output, where it fits with export and file-level import in APEX 26.2, and how to use it in CI and with AI coding agents.

AI-readable summary

SQLcl's apex validate command compiles an APEXlang application folder or zip file and reports each problem with its file, line, column, type and message, or prints Validation successful. It works without a database connection when SQLcl is started with /nolog, which makes it a cheap gate for CI pipelines and for AI coding agents editing .apx files. Import always validates first, but validating earlier catches errors before anything touches a database. APEX 26.2 requires SQLcl 26.3.0 or later, and SQLcl 26.3.0 adds more than 30 CodeScan rules for .apx files. Validation proves an application compiles, not that it behaves correctly, is secure or handles data well, and Oracle does not document its exit codes, so pipelines should gate on the logged output.

The short version

An APEXlang application is a folder of .apx text files. SQLcl’s apex validate compiles that folder and tells you, line by line, what is wrong. The part that gets less attention: it does not need a database.

$ sql /nolog
SQL> apex validate -input .

That makes validation the cheapest check you can put in front of an APEX change:

  • Offline. No credentials, no network path to a database.
  • Precise. Every problem comes with file, line, column, type and message.
  • Automatable. Run it on every pull request and after every AI agent edit, before any import.
  • Versions. APEX 26.2 requires SQLcl 26.3.0 or later, which also adds CodeScan rules for .apx files.

Our broader article on APEXlang file-level import in APEX 26.2 covers single-file import and compare and pull. This one goes deep on validation: what it checks, what it misses and how to build on it.

What apex validate actually checks

In Oracle’s words, “SQLcl, ORDS, and SQL Developer share a common APEXlang compiler driven by the rules that Page Designer has used for years.” Validating in SQLcl runs the same compiler that checks an import.

The compiler is metadata driven: it knows which components exist, their properties and child components, and when each applies. Oracle’s examples: an interactive report region has nested column definitions and a form region does not; a chart region has a zoomAndScroll property and a classic report does not. Oracle calls this meta-metadata (MMD).

Each application records the MMD version it was exported with in .apex/apexlang.json, so the compiler applies the right rules. Do not modify that file by hand, and do not let an agent do it either.

Running it and reading the output

The input is a path to an application directory or a zip file. If your current directory is the application root, you can omit -input; SQLcl’s cd and pwd commands work at the prompt.

A clean run prints Validation successful. Otherwise you get one block per problem under an APEXLang Compile Errors: header. This one is from Oracle’s documentation, after a deliberate typo in a region reference:

File: pages/p00003-employee.apx
Line: 117
Column: 12
Type: REFERENCE_NOT_FOUND
Error: Reference not found: @employe
  • File, Line, Column: where the problem is, with paths relative to the application folder in Oracle’s examples.
  • Type: a machine-readable category. Oracle’s examples show REFERENCE_NOT_FOUND, INVALID_PROPERTY, LOV_NOT_FOUND and DUPLICATED_COMPONENT. We found no published list of all types.
  • Error: the message. Some carry the fix: for a misspelled data type, Oracle’s example lists the valid values.

In Oracle’s own sample, line 123 is reported before line 117, so do not assume sorted output. In SQL Developer for VS Code, the same errors appear in the Problems panel as you edit.

Spool it to a log

SQLcl’s spool command captures console output in a file, which is what you want in CI:

SQL> spool validate.log
SQL> apex validate -input .
SQL> spool off

Connected versus offline validation

Oracle’s main procedure connects to the workspace parsing schema first, then makes the key point: importing requires that connection, validating does not. Under /nolog, validation still compiles the application and reports errors and warnings. Oracle names two uses: an application downloaded from an APEX instance you cannot reach directly over the network, and an AI coding agent discovering and fixing its own errors.

The documentation does not say whether a connection adds checks, for example against tables or columns in the parsing schema. We found no statement either way, so we treat offline validation as a structural check of the application definition, nothing more.

The connected check you always get is import. In Oracle’s words, “Importing an APEXlang app always validates it first”, with the same errors and warnings as apex validate, and SQLcl proceeds when no errors are detected. Offline validation is the same gate, moved earlier, where it costs almost nothing.

Where validation fits with export and file-level import

A SQLcl session under sql /nolog: apex validate reports a REFERENCE_NOT_FOUND error with file, line, column and type, then Validation successful after the fix. Beside it, the pipeline: export, edit, validate offline, compare and pull, then import, which validates again
Validate after every edit and every pull. Import validates again, but by then the answer should already be known.

Export. apex export -applicationid 104 -exptype apexlang writes the application folder. After an APEX upgrade, Oracle recommends that Git-first teams re-import every application and re-export it with -force on a dedicated branch, so structural changes land in one commit. -force removes the application alias directory first, so keep the repository root at least one level above it. Validate that commit; it is your new baseline.

File-level import. In 26.2, apex import -files imports only the files you list, and the release notes position it for development environments only. We found -files documented for import, not for validation. Our rule: validate the whole application before a file-level import, so a page that points to a shared component missing from your folder fails with a reference error before it reaches a database.

Compare and pull. SQL Developer for VS Code 26.3 or later can pull App Builder changes into your local .apx files. Oracle’s sequence is review, resolve conflicts, validate, import. Pulled changes are still changes, so validate after every pull.

A CI pipeline, step by step

Oracle says these SQLcl commands let teams integrate APEXlang into automated pipelines and CI/CD workflows, but publishes no reference pipeline. Here is the shape we use, as steps rather than any one CI system’s syntax.

  1. Pin SQLcl. APEX 26.2 requires SQLcl 26.3.0 or later, and Oracle recommends keeping SQLcl current. Upgrade it in CI whenever you upgrade APEX.
  2. Check out the branch. No database credentials or network route needed.
  3. Run a script. SQLcl accepts /nolog plus a start script, as in sql /nolog @validate.sql. Our hypothetical validate.sql, built only from documented commands and run from the application root:
spool validate.log
apex validate -input .
spool off
exit
  1. Decide pass or fail from the log. Oracle does not document whether a failed apex validate changes SQLcl’s exit status, or how warnings affect the success message. We fail the job unless the log contains Validation successful. Test this on your SQLcl version.
  2. Publish the log. File, Line and Type map easily to pull request annotations.
  3. Add CodeScan as its own job, advisory at first.
  4. Only then go connected. Import into a development application or Working Copy and run your tests. APEX 26.2 adds LOCK_APPLICATION, UNLOCK_APPLICATION and CREATE_WORKING_COPY to APEX_APPLICATION_ADMIN, designed, in Oracle’s description, for trusted CI/CD integrations.
  5. Release as a full application. Test and production get a complete, validated export.

CodeScan for APEXlang in SQLcl 26.3.0

Validation asks whether the application compiles. CodeScan asks whether it follows good practice. The APEX 26.2 release notes deprecate APEX Advisor and point to SQLcl 26.3.0, whose built-in CODESCAN utility gains native code quality and security rules for APEXlang applications. The SQLcl changelog puts it at more than 30 rules for .apx files.

Oracle’s APEX 26.2 new features deck shows the command, with the export directory as the argument:

SQL> codescan -ext .apx export-dir

The deck’s supported checks include authorization requirements, hidden-item value protection, and session limits and security defaults: security-configuration findings to catch before deployment.

Documentation is still thin. The SQLcl 26.3 User’s Guide CODESCAN page documents -path, -format, -ignore, -output and -settings for SQL, PLS and PLB files, with no mention of .apx files, the extension option or APEXlang rule IDs, and Oracle’s roadmap still lists “APEXlang static analysis via SQLcl”. Our advice: run CodeScan as a non-blocking job, review its findings on your applications, then decide which should block a merge.

A safety net for AI coding agents

Oracle’s guidance for agents is simple: treat validation as part of the editing loop, and import only after the source validates cleanly. SQLcl’s skills sync command installs or updates Oracle’s APEXlang skills, and SQLcl 26.3.0 also offers a skills_sync MCP tool.

In our view, offline validation is what makes that loop safe. The agent edits .apx files, runs apex validate, reads file, line, type and message, fixes and repeats, all without database credentials.

How we set agents up:

  • No database access in the edit loop. Import is a pipeline or human step.
  • Protected files. Never edit .apex/apexlang.json or files in generated-artifacts, which Oracle says should not be modified manually.
  • Whole application. Validation takes an application directory or zip file. Single-file compilation is listed on Oracle’s roadmap.
  • Review the diff. A clean validation is where code review starts.
A funnel of four checks for APEXlang changes: offline apex validate for properties, references, duplicates and structure, SQLcl CodeScan with 30+ rules for .apx files, connected import, and testing and review for runtime, security, data and environment
Each layer catches a different class of problem. Offline validation is the first and cheapest, not the only one.

What validation does not catch

A clean result means the application compiles. It does not mean the application works.

  • Runtime behavior. SQL in regions, PL/SQL processes and dynamic actions run only at runtime. Oracle does not document checks of SQL or PL/SQL against database objects, and offline there is no database to check against.
  • Security. A page missing the authorization scheme it needs can be perfectly valid APEXlang. CodeScan covers some security configuration; testing and review cover the rest.
  • Data. Validation never touches data. Oracle also advises against versioning Full exports, which may include application data.
  • Environment. Web Credentials and Remote Servers set to Prompt on Install need values per environment, and the 26.2 known issues say imports through clients such as SQLcl need manual preinstallation for them.
  • Concurrent edits. Validation checks your files, not App Builder changes made since your export. Compare and pull covers that.

Checklist

  • SQLcl 26.3.0 or later wherever you validate or import
  • apex validate -input . offline on every pull request, spooled to a published log
  • Pass or fail decided from the log, not an assumed exit code
  • Whole application validated before any file-level import and after every compare and pull
  • .apex/apexlang.json and generated-artifacts never edited by hand
  • Re-export with -force on its own branch after each APEX upgrade, then validate
  • CodeScan on .apx files as an advisory job at first
  • Agents validate offline; imports stay in the pipeline; production gets full imports

Validation runs anywhere SQLcl runs; imports, tests and releases need environments where APEX, ORDS and SQLcl are upgraded together. APEX 26.2 is available now for on-premises installations, with Oracle Autonomous AI Database following shortly and OCI and multicloud rollouts over the coming weeks. For managed development, test and production APEX environments, see Cloud Hosting and the plans page.

Bottom line

apex validate under /nolog is the smallest useful gate in an APEXlang workflow: no database, no credentials, precise output. Put it in front of every import, every pull request and every agent edit.

Then remember what it is: a compiler check. Lint first, import second, and keep testing, security review and full releases where they belong.

FAQ

Does apex validate need a database connection?

No. Importing needs a connection to the workspace parsing schema; validation does not. Start SQLcl with sql /nolog and run apex validate -input . from the application root.

What does the validation output contain?

Either Validation successful, or one block per problem with file, line, column, type and error message. Capture it with SQLcl’s spool command.

If import validates anyway, why validate separately?

Because it runs earlier and needs no connection, so you get the same compiler feedback on every commit, in CI and inside an agent’s edit loop.

Which SQLcl version do I need for APEX 26.2?

SQLcl 26.3.0 or later, according to the APEX 26.2 release notes.

Does a failed validation return a non-zero exit code?

Oracle does not document this. Decide pass or fail from the spooled log, for example by requiring Validation successful, and test it on your SQLcl version.

Is CodeScan the same as apex validate?

No. apex validate checks that the application compiles against APEX metadata. CodeScan in SQLcl 26.3.0 adds more than 30 code quality rules for .apx files, including security configuration checks.

Sources