view with pipeline function
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