can we have a SQL query inside CASE/DECODE?
Hi
I am trying something like this:
select sid,case con_id when 1 then 'ROOT'
when 2 then 'SEED'
when 3 then 'select name from v$pdbs'
else to_char(con_id) end
from v$session where sid=2294;
When value is 3, it just shows the entire SQL but does not run as to show the output of it. I assume it is not permitted to have SQL inside CASE or DECODE, but I am trying to find if there is a way to do so.
Thanks