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 Gives Error

  3. 1000

  4. 2000

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

The cursor is declared but never opened or fetched from in the execution block. The dbms_output.put_line(n) outputs the initialized variable value of 2000, not any value from the cursor. Without opening and fetching, the cursor query doesn't execute.