PL/SQL (MOSC)

MOSC Banner

view with pipeline function

edited Jun 20, 2017 5:04AM in PL/SQL (MOSC) 2 commentsAnswered

I have a pipelined function:
Called getLogData(sessionid Number)

I can execute this query:

select * from table(getlogdata(sessionid=>215537754)) order by id;

Does anyone know of a way I can turn this query into a view?

Below is my pipelined function:

Thanks
Debbie

create or replace function getlogdata(sessionid number) return applicationlogall_table pipelined
  is
   cursor schemaCur is
     select * from applicationsessionschema where sessionid = getlogdata.sessionid;
   schemaRec schemaCur%rowtype;
   type l_cur_type is ref cursor;
   l_cur l_cur_type;
   applogRec applicationlog%rowtype;
   l_sql varchar2(4000);
begin
  Open schemaCur;
  Loop
    fetch schemaCur into schemaRec;
    exit when schemaCur%notfound;
    l_sql := 'select * from '||schemaRec.schemaname||'.applicationlog

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