Oracle Procedure Returns the result set ____oracle

Source: Internet
Author: User

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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.