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
-
Null
-
It Throws Error
-
1000
-
2000
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.