Multiple choice technology databases

What is the smallest PL/SQL Block?

  1. Begin Dbms_output.put_line('Heello World'); exception when others then Dbms_output.put_line('error'); end; /

  2. Begin null; End;

  3. Declare a varchar2(100) := 'Hello World'; Begin Dbms_output.put_line(a); exception when others then Dbms_output.put_line('error'); end; /

  4. begin Dbms_output.put_line('Heello World'); end; /

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The smallest valid PL/SQL anonymous block must contain a BEGIN and END clause; the body can be a single null statement. The block BEGIN NULL; END; meets this requirement and compiles, making it the correct minimal example. The stored answer correctly identifies this option.