Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> How to return a record set from Stored Proc?

How to return a record set from Stored Proc?

From: Bill Han <billxhan_at_hotmail.com>
Date: Fri, 04 Jan 2002 01:31:18 GMT
Message-ID: <GB7Z7.20629$DO.2654967@news1.calgary.shaw.ca>


Greeting all,

How can I return a record set from a Oracle stored procedure? I was heard the term REF CURSOR (?) somewhere for this purpose. What's that? How to use it?

Can someone write a simple code to demonstrate how to do that? I appreciate it!

Let's say I have a sp as follows:

CREATE OR REPLACE PROCEDURE my_proc
( p_dept_id IN NUMBER) AS
BEGIN
    SELECT * FROM EMP WHERE dept_id = p_dept_id END How to change that in order to return a record set to the caller (VB, ADO)?

Thanks,
Bill Han Received on Thu Jan 03 2002 - 19:31:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US