select
z.*
from
(
select
y.*,
nvl2(y.error_message,'Error','Valid') validation_result
from
(
select
x.lov_name,
x.report_name,
x.parameter_name,
xxen_report.validate_sql(replace(regexp_replace(x.lov_query,':\$flex\$\.(\w+)\.value(\W|$)',':$flex$.v__\1\2',1,0,'i'),':$flex$.',':f_'),'parse') error_message,
x.lov_query
from
(
select
xrpl.lov_name,
null report_name,
null parameter_name,
xrpl.lov_query
from
xxen_report_parameter_lovs xrpl
where
1=1
union all
select
null lov_name,
xrpv.report_name,
xrpv.parameter_name,
xrpv.lov_query
from
xxen_report_parameters_v xrpv
where
2=2 and
xrpv.parameter_type='LOV' and
xrpv.lov_id is null
) x
) y
) z
where
3=3
order by
z.lov_name |