Multiple choice technology databases

You create the following PL/SQL block: DECLARE var1 CONSTANT NUMBER := 50; var2 NUMBER := 0; BEGIN SELECT acctno INTO var2 FROM bank_acct WHERE name = 'JORDAN'; var1 :=var2 + 2000; END; Which of the following lines in this block of PL/SQL code will produce an error? (Choose One)

  1. var2 NUMBER := 0;

  2. INTO var2

  3. WHERE name = 'JORDAN';

  4. var1 :=var2 + 2000;

  5. There are no errors in this PL/SQL block.

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

var1 is declared as CONSTANT, which means its value cannot be changed after initialization. Attempting to assign a new value to var1 with 'var1 := var2 + 2000' will raise a compilation error. The other lines are valid PL/SQL syntax - declaring variables and using SELECT INTO are standard operations.