you may to use Exception
when no_Data_Found then

Begin
Select ...
from B
where your want ...;
end;