I'm having issues while running the following query (interactive report / simplified the query cause I'm sure the issue is with the case statement):
select
v.manager_email
from my_table v
where
(
case
when :P28_ACT_AS_ROLE_H = 'Director' then v.director_email = :P28_ACT_AS_H
when :P28_ACT_AS_ROLE_H = 'Admin' then v.manager_email = nvl(:P28_ACT_AS_H,
v.manager_email)
when :P28_ACT_AS_ROLE_H = 'Manager' then v.manager_email = :P28_ACT_AS_H
end
)
The error is this one: ORA-20999. Does someone know why this is happening? (:p28 items are calculated via computations and work perfectly)
Thanks!