Multiple choice

In this PL/SQL statement, which of the following lines will produce an error?

  1. create or replace function vat (vat_rate IN NUMBER, price IN NUMBER)

  2. declare

  3. l_vat NUMBER;

  4. begin

  5. l_vat := (vat_rate/100) * price; return l_vat;

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

In Oracle PL/SQL, functions use the IS or AS keyword to begin the declaration section, not DECLARE. The DECLARE keyword is used only in anonymous PL/SQL blocks, not in named program units like functions or procedures. The correct syntax for a function uses IS/AS after the parameter list to begin the declaration section.