Hi I am trying to use for loop for retrieving data in oracle pl/sql but I am getting an error can someone help me
SET SERVEROUTPUT ON
DECLARE
fname employees.first_name%TYPE;
empid employees.employee_id%TYPE;
CURSOR emp_cursor IS
SELECT employee_id,first_name from employees ORDER BY employee_id;
BEGIN
open emp_cursor;
FOR empid IN emp_cursor loop
DBMS_OUTPUT.PUT_LINE('employee id is ' ||empid || 'first name is '||fname);
end LOOP;
END;
I am getting an error on the DBMS output line something like the number or type of variables not right. I am trying to retrieve employee id and first name from employees table in oracle sample schema.
Can someone please guide me