Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> How to return a record set from Stored Proc?
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
![]() |
![]() |