here is my code,
declare
cursor c_emp is
select ename, sal, mgr from emp;
emp_detail emp%rowtype;
begin
open c_emp;
loop
fetch c_emp into emp_detail;
exit when c_emp%NOTFOUND;
dbms_output.put_line(emp_detail);
end loop;
close c_emp;
end;
/
getting this error,
ERROR at line 8: ORA-06550: line 8, column 13: PLS-00394: wrong number of values in the INTO list of a FETCH statement ORA-06550: line 8, column 13: PL/SQL: SQL Statement ignored ORA-06550: line 10, column 13: PLS-00306: wrong number or types of arguments in call to 'PUT_LINE' ORA-06550: line 10, column 13: PL/SQL: Statement ignored
For this error i got wasted much of time time but finally i got my answer by own, now question is why i am posting this, answer do not want other to wasted time like me in that so,
dbms_output.put_line prints a string.
emp_detailis not a string, it is a%ROWTYPE, you can't print that as such. What you can do is print one (or more) columns from the rowtype. Example: