How to Return a Result Set from an Oracle Procedure Using SYS_REFCURSOR

Learn to pass `varchar` parameters in an Oracle PL/SQL procedure and return a dynamic result set using `sys_refcursor`. A practical code example.

Learn to pass `varchar` parameters in an Oracle PL/SQL procedure and return a dynamic result set using `sys_refcursor`. A practical code example.
create or replace procedure e_name
  2      (
  3      p_ids in varchar2,
  4      p_name in varchar2,
  5      p_csr out sys_refcursor
  6      ) as
  7  begin
  8      open p_csr for
  9         select object_name, owner, object_type
 10         from all_objects
 11         where object_name = upper(p_name)
 12         and owner = upper(p_ids);
 13  end;
 14  /

 

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments