Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Returning Rows from a Stored Procedure in Oracle...can it be done?
In MS SQL server, I am able to have a store procedure that returns a result
set and use it Via ADO recordset. How do I do this in Oracle?
Sample SQL server Code....
CREATE PROCEDURE spGetUsers(@UID INTEGER) BEGIN /* Heres some sort of condition statement*/
IF @UID > 10
BEGIN
/*Return Users with UID < 10*/ SELECT UID,UserName FROM tblUser WHERE UID < @UID END ELSE BEGIN /*Return Users with UID > 10*/ SELECT UID,UserName FROM tblUser WHERE UID > @UID END
END Sample ADO Code (in VB5)....
Dim dbCon As New ADODB.Connection
Dim RS As New ADODB.Recordset
'connect to the database
dbCon.Open "DSN=MyDB", "sa", ""
'Execute the SQL Statement
RS.Open "EXEC spGetUsers 23", dbCon, adOpenForwardOnly
*This should fill the RS with the records returned by spGetUsers*
Any help would be appreciated
(If possible, please Cc: me by email)
Thanks
Ryan Gallagher
Received on Tue Oct 27 1998 - 12:16:25 CST