The following code is setting the variable vBoleto to null when the select above return no rows. Can someone explain why please?
while (true) loop
begin
select id_boleto_origem
into vOrigem
from sn_boleto
where id_boleto = vBoleto;
vBoleto := vOrigem;
exception
when no_data_found then
exit;
end;
end loop;