Skip to main content

Static analysis for PL/SQL and Oracle SQL

ZPA parses database code into structured syntax, then applies checks that understand PL/SQL and Oracle SQL semantics.

Open source · LGPL-3.0 · SonarQube Community Build 26.2+

order_discount.sqlzpa-cli 3.2.1 · 5 findings
CREATE OR REPLACE FUNCTION order_discount(p_order_id NUMBER) RETURN NUMBER IS  v_total    orders.total%TYPE;  v_created  orders.created_at%TYPE;  v_discount NUMBER;BEGIN  SELECT total, created_at    INTO v_total, v_created    FROM orders   WHERE id = p_order_id;
  IF v_created < TO_DATE('03/04/2026') THEN    RETURN 0;  ELSIF v_total > 1000 THEN    RETURN v_total * 0.10;  ELSIF v_total > 1000 THEN    RETURN v_total * 0.05;  END IF;
  RETURN 0;END;
  1. Minorline 1ExplicitInParameterExplicitly declare this parameter as IN.
  2. Majorline 4UnusedVariableRemove this unused "V_DISCOUNT" local variable.
  3. Criticalline 6QueryWithoutExceptionHandlingHandle exceptions of this query.
  4. Majorline 11ToDateWithoutFormatSpecify the date format in this TO_DATE.
  5. Blockerline 15DuplicateConditionIfElsifThis code cannot be reached because the condition duplicates a previous condition in the same sequence of "if/else if" statements.

Analyze the code that runs in Oracle

PL/SQL

Anonymous blocks, packages, procedures, functions and declarations are parsed as structured code.

Oracle SQL

SELECT and DML grammar inside database programs is available to rules as named syntax.

Oracle Forms

Code and metadata extracted from Forms modules, with object references checked against the form. Analyze Oracle Forms

utPLSQL reports

The SonarQube plugin imports test execution and coverage reports alongside analysis results. Read the integration guide

Choose where to run ZPA

Both use the same analyzer and built-in rules. Choose the integration that fits your workflow.

Standalone CLI

For local analysis and CI jobs.

  • Scans a source directory.
  • Writes console or Sonar Generic Issue Data.
  • Supports JSON configuration and custom rule plugins.
Read the CLI guide