sql - How should I use the cursor in the Function? -


i want use cursor in package's function this:

package pkg type result_t   table of varchar2(30); function generatef   return result_t pipelined; end pkg; / create or replace package body pkg function generatef   return result_t pipelined begin   tlc in (select name users)   loop     pipe row(tlc.name);   end loop;   return; end; end pkg; / select * table(pkg.generatef); 

i think right issue focusing on

select name users 

because if use

select sysdate dual 

the function works well.

if want extract data other view, bring error this:

error(7,45): pl/sql: ora-00942: table or view not exist".

but actually, view exists.

i don't know problem. , i'm not sure whether it's ok use cursor mentioned.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -