Hi,
I want to handle NO Data found in for loop cursor. I am unable to print No data found in exception.
Could you please correct me where i am wrong?
declare
cursor c1 (l_id in number) then
select emp_name , salary from emp where emp_id=l_id;
Begin
for rec_c2 in c1(p_id) loop
dbms_output.put_line (rec_c2.emp_name || rec_c2.salary);
end loop;
exception
when no_data_found then
dbms_output.put_line ('no data found');when others then
dbms_output.put_line (substr(SQLERRM,100));
end;