SET SERVERIUTPUT ON DECLARE v_ename EMP.ENAME%TYPE. v_salary EMP.SALARY%TYPE. CURSOR c_emp IS SELECT ename,salary FROM emp. BEGIN OPEN c_emp. FETCH c_emp INTO v_ename,v_salary. DBMS_OUTPUT.PUT_LINE( Salary of Employee || v_ename || is || v_salary). FETCH c_emp INTO v_ename,v_salary. DBMS_OUTPUT.PUT_LINE( Salary of Employee || v_ename || is || v_salary). FETCH c_emp INTO v_ename,v_salary. DBMS_OUTPUT.PUT_LINE( Salary of Employee || v_ename || is || v_salary). CLOSE c_emp. END
SET SERVERIUTPUT ON DECLARE v_ename EMP.ENAME%TYPE. v_salary EMP.SALARY%TYPE. CURSOR c_emp IS SELECT ename,salary FROM emp. BEGIN OPEN c_emp. LOOP FETCH c_emp INTO v_ename,v_salary. EXIT WHEN c_emp%NOTFOUND. DBMS_OUTPUT.PUT_LINE( Salary of Employee || v_ename || is || v_salary). END