大家好,我正在研究 apex 19.1 在创建经典报告时遇到一些错误,该报告在块下执行时,
declare
vquery varchar2(4000);
BEGIN
if
(:P3_POSTCODE is not null
and
:P3_HUISNR is not null
)
then
vquery :='SELECT * FROM LVV_AANSLUITPUNT where lvv_aansluitpunt.la_post_code = :P3_POSTCODE
and lvv_aansluitpunt.la_huis_nr = :P3_HUISNR and ((lvv_aansluitpunt.la_dat_aanvang is not null
and lvv_aansluitpunt.la_dat_eind is null ) or (lvv_aansluitpunt.la_dat_aanvang is null
and lvv_aansluitpunt.la_dat_eind is null )) and lvv_aansluitpunt.an_code is not null
and lvv_aansluitpunt.vl_id is not null
and not exists (select '*' from lvv_juridische_lever jl where jl.vv_id = lvv_aansluitpunt.vv_id and upper(jl.nv_code) ="B")
and exists (select '*' from lvv_vv_leiding vl where vl.vl_id = lvv_aansluitpunt.vl_id
and ((vl.vl_dat_aanvang is not null and vl.vl_dat_eind is null ) or (vl.vl_dat_aanvang is null and vl.vl_dat_eind is null )))
and exists (select '*' from lvv_vaste_verbinding vv , lvv_soort_artikel sa where vv.vv_id = lvv_aansluitpunt.vv_id and vv.sa_code = sa.sa_code and sa.sa_aansl_drager_j_n = "J")';
else
vquery := 'select distinct sa.sa_code
, sa.sa_type_verbinding
, vv.vv_id
, nvl(vv.vv_lijnbenaming_nw,vv.vv_lijnbenaming)
, vl.vl_id
, vl.vl_lijnbenaming
from lvv_soort_artikel sa
, lvv_vv_leiding vl
, lvv_juridische_lever jl
, lvv_ldm_aansluitpunt la
, lvv_vaste_verbinding vv
where :P3_VV_LIJNBEN =
nvl(vv.vv_lijnbenaming_nw,vv.vv_lijnbenaming)
and vv.vv_id = vl.vv_id
and vv.vv_id = jl.vv_id
and vv.vv_id = la.vv_id
and vv.sa_code = sa.sa_code
and la.an_code is not null
and vl.vl_id is not null
and jl.nv_code <> "B"
and sa.sa_aansl_drager_j_n = "j"
and ((la.la_dat_aanvang is not null
and
la.la_dat_eind is null
)
or
(la.la_dat_aanvang is null
and
la.la_dat_eind is null
))
and ((vl.vl_dat_aanvang is not null
and
vl.vl_dat_eind is null
)
or
(vl.vl_dat_aanvang is null
and
vl.vl_dat_eind is null
))';
end if ;
RETURN vquery;
end;
执行时返回的错误是:- ORA-20999:解析返回的查询导致“ORA-20999:解析 SQL 查询失败!
ORA-06550:第 24 行,第 40 列:ORA-00904:“j”:无效标识符
”。