Oracle Segment: First set up Package and Package Body in Oracle, the function and stored procedure return result set will be defined. 1: Set PACKAGE: CREATE OR REPLACE package SCOTT.pk_wtistype mytype is ref cursor; procedure p_wt (mycs out mytype); function f_get (str in varchar2) return varchar2; end; / Description: In fact, just a statement PACKAGE nothing. We define a stored procedure to return junctions and a function, return a string. 2: Create package body: create or replace package body scott.pk_wtisprocedure p_wt (mycs out mytype) isbeginopen mycs for select * from test; end p_wt;
Function f_get (str varchar2) return varchar2isstr_temp varchar2 (100): = 'Good luck!'; beginstr_temp: = str_temp || str; return str_temp; end f_get;