begin
vn_flag := 17;
:bl_empr_usu.v_perm_fat_nf_venc := fg_param_adm( 'PERM_NF_TIT_VENC_MEN'
, 'FAT'
, :global.emprusu
, 0 -- deve obrigatóriamente existir na cg_ref_code
);
exception
when vê_insere_r then
pl_variaveis.vv_insere_r := 'S';
if vn_flag = 17 then
pl_variaveis.vv_nome := 'PERM_NF_TIT_VENC_MEN';
end if;
pl_insere_r;
end;
and all these begins are inside a bigger begin.
And in this bigger begin has another exception:
EXCEPTION
when vê_insere_r then
pl_variaveis.vv_insere_r := 'S';
if vn_flag = 1 then
pl_variaveis.vv_nome := 'PED_VENDA_LIB_REP';
elsif vn_flag = 2 then
pl_variaveis.vv_nome := 'PED_REMESS_LIB_REP';
elsif vn_flag = 3 then
pl_variaveis.vv_nome := 'CTR_VENCTO_PEDIDO';
elsif vn_flag = 4 then
pl_variaveis.vv_nome := 'VER_VALID_CNPJ_CLI';
elsif vn_flag = 5 then
pl_variaveis.vv_nome := 'PERM_DT_RETROAT_NF';
...
Here comes the question ...
How can he fall on the exception vê_insere_r if he does not have raise anywhere ??
and of course chi case fall in the last exception the VN_FLAG will be equal to 22!
and do not have the when others também .... = D