Skip to main content
← PL/SQL Topics

Language Basics

Explain the NULL statement and when to use it

The NULL Statement

ExplanationOracle Fusion / EBS · Technical · PL/SQLHigh confidenceGenerated

NULL; is a do-nothing executable statement used to make 'no action' explicit or to satisfy syntax that requires a statement.

How it works

PL/SQL requires at least one statement in any executable section or branch. The NULL statement does nothing but is a valid statement — use it to say 'deliberately handle this case by doing nothing' (e.g. a WHEN branch or an exception handler you want to swallow on purpose), or as a placeholder in a stub you will fill in later. It also documents intent: a reviewer sees the empty case was considered, not forgotten.

How it works
DECLARE
  v_status VARCHAR2(10) := 'SKIP';
BEGIN
  CASE v_status
    WHEN 'RUN'  THEN DBMS_OUTPUT.PUT_LINE('processing');
    WHEN 'SKIP' THEN NULL;               -- intentionally no action
    ELSE RAISE_APPLICATION_ERROR(-20010, 'Unknown status ' || v_status);
  END CASE;
END;
/

Related questions

GroundingGenerated

Model-generated, grounded against the curated knowledge layer. Check specifics against your instance.

Have a follow-up, or a different question?

Continue in Ask Oracle AI