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
Post a Comment