inline function + common table extension
Hi all,
I am have a hard time to use inline function and common table extension at the same time, Consider the following:
-- just common table (subquery) OK
with xx as (select * from V$session)
select * from xx;
-- just inline function OK
with function fn_dummy(enum number )return number
is begin
return (enum * 3);
end fn_dummy;
select fn_dummy(3) from dual;
-- combine both NOT OK
with xx as (select * from V$session)
, function fn_dummy(enum number )return number
is begin
return (enum * 3);
end fn_dummy;
select fn_dummy(sid) from xx;
Error:
ORA-00942: table or view does not exist