Multiple choice technology databases

What is the Output of the Following Program: declare n number := 2000; cursor c1 is select sal into n from emp where empno = 7788; begin dbms_output.put_line(n); end; Data in Emp Table empno sal 123 1000

  1. Null

  2. It Throws Error

  3. 1000

  4. 2000

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

The cursor c1 is declared but never opened - only the declaration section contains the cursor definition. Since the cursor is not opened or fetched, the value of n remains unchanged at its initialized value of 2000. The dbms_output.put_line(n) displays 2000. The sal value from emp table (1000) is never retrieved because the cursor was never opened.