Aí vai:
Selecionar tudo
if :batch_status = '1' then
:cp_batch_status := 'Error';
elsif :batch_status = '2' then
:cp_batch_status := 'Error';
elsif :batch_status = '3' then
:cp_batch_status := 'Error';
elsif :batch_status = '4' then
:cp_batch_status := 'Error';
elsif :batch_status = '5' then
:cp_batch_status := 'Error';
elsif :batch_status = '6' then
:cp_batch_status := 'Error';
elsif :batch_status = '7' then
:cp_batch_status := 'Error';
elsif :batch_status = '8' then
:cp_batch_status := 'Error';
elsif :batch_status = 'A' then
:cp_batch_status := 'Error';
elsif :batch_status = 'C' then
:cp_batch_status := 'Error';
elsif :batch_status = 'F' then
:cp_batch_status := 'Error';
elsif :batch_status = 'J' then
:cp_batch_status := 'Error';
elsif :batch_status = 'M' then
:cp_batch_status := 'Error';
elsif :batch_status = 'P' then
:cp_batch_status := 'Posted';
elsif :batch_status = 'U' then
:cp_batch_status := 'Unposted';
else
:cp_batch_status := 'Error';
end if;
Acho que isso poderia ser assim:
Selecionar tudo
if :batch_status = 'P' then :cp_batch_status := 'Posted';
elsif :batch_status = 'U' then :cp_batch_status := 'Unposted';
else :cp_batch_status := 'Error';
end if;