我是一名实习开发人员,负责其他人的代码,所以我的大部分工作都是修改他们的工作。我在 Oracle 10g 上使用报表生成器。
我在公式中有以下设置:
function get_addressFormula return Char is
begin
if :payee_ctc_id is not null then
begin
select a.address
,a.address2
,a.address3
,g.location
,g.ppostcode
into :address1
,:address2
,:address3
,:address4
,:postcode
from ctc_address a
,geo_locations g
where a.addresstypeid = 1
and a.costcentreid = :payee_ctc_id
and g.locationid = a.locationid
and a.addressid = (select max(i.addressid)
from ctc_address i
where i.costcentreid = :payee_ctc_id
and i.addresstypeid = 1);
exception
when others then
return null;
while trim(:address1) is null and (trim(:address2) is not null or trim(:address2) is not null or trim(:address4) is not null)
loop
:address1 := :address2;
:address2 := :address3;
:address3 := :address4;
:address4 := '';
end loop;
while trim(:address2) is null and (trim(:address3) is not null or trim(:address4) is not null)
loop
:address2 := :address3;
:address3 := :address4;
:address4 := '';
end loop;
while trim(:address3) is null and trim(:address4) is not null
loop
:address3 := :address4;
:address4 := '';
end loop;
end;
else
begin
<else code>
end;
end if;
return 'y';
end;
这是除了最后一个 else 块之外的全部功能。我试过 no_data_found 但还是不行。
@tbone。我不知道该怎么做。到目前为止,我在 RAISE 上进行了一些谷歌搜索,但运气不佳。