SQL Language (MOSC)

MOSC Banner

inline function + common table extension

edited Oct 18, 2018 12:36PM in SQL Language (MOSC) 3 commentsAnswered ✓

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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center