Oracle Procedure 返回结果集

方法一: Package 和 Procedure 的做法

先创建一个返回结果集的游标:

create or replace package pkgaccq_tbuserpr
is
type result is ref cursor;
end pkgaccq_tbuserpr;

用上面定义的结果集来乘放抛出的结果结:

create or replace procedure praccq_tbuserpr
(
cresult in out pkgaccq_tbuserpr.result       ------引用定义的package cursor
)
is
begin
open cresult for
select * from tb_color;
end praccq_tbuserpr;

方法一: Package 和 Package Body 的做法

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 out result)
is
begin
open ocur_result for
select * from tb_user;
end prq_tb_user;
end pgaccq_tbuser;

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zwxrain/archive/2006/10/26/1351614.aspx

posted on 2010-08-25 09:45  ewyb  阅读(1038)  评论(0编辑  收藏  举报

导航