Regarding "select into" query and "no data found" exception
750952Mar 11 2010 — edited Mar 11 2010So i have included the following into my procedure:
select div_cd into c_div_cd
from division_tab d, emp_tab y
where d.div_name=y.div_text and y.emp_code=d.emp_code;
and also an exception
exception
when no data found
-- print something
The above select query results into "no data found" and the control passes directly to the exception and prints something.
How do I do the following?
select div_cd into c_div_cd
from division_tab d, emp_tab y
where d.div_name=y.div_text and y.emp_code=d.emp_code;
if c_div_cd is null then
--enter this employee into some other table without raising an exception
No need to write a code for an answer. Please just guide me with something I can incorporate or do.