Method One: The practice of Package and Procedure
First, create a cursor that returns a result set:
Create or Replace package PKGACCQ_TBUSERPR
Is
Type result is REF CURSOR;
End PKGACCQ_TBUSERPR;
Multiply the result knot that is thrown by using the result set defined above:
Create or replace procedure PRACCQ_TBUSERPR
(
Cresult in Out pkgaccq_tbuserpr.result------reference-defined package cursor
)
Is
Begin
Open Cresult for
SELECT * from Tb_color;
End PRACCQ_TBUSERPR;
Method One: Package and Package body procedure
Package:
Create or Replace package Pgaccq_tbuser is
---public type declaration
Type result is REF CURSOR;
Procedure Prq_tb_user (Ocur_result in out result);
End Pgaccq_tbuser;
Package Body:
Create or Replace package body Pgaccq_tbuser is
Procedure Prq_tb_user (Ocur_result in)
Is
Begin
Open Ocur_result for
SELECT * from Tb_user;
End Prq_tb_user;
End Pgaccq_tbuser;